![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||
| ||||
|
|
Are there any guidelines people use that help them decide when it is better to dynamically generate all html elements using javascript versus actually writing some html and using it as scaffolding? |
|
I have been using the extjs framework ( I haven't see this library |
|
critiqued much on this forum - unlike prototype, jquery and dojo |
|
Would really appreciate your thoughts. |
#3
| |||
| |||
|
|
Faisal Vali a écrit : Are there any guidelines people use that help them decide when it is better to dynamically generate all html elements using javascript versus actually writing some html and using it as scaffolding? The only way is to code : - all in html, eventually with css, exceptionally with few images - adding JS for some non really useful dynamism, not more |
|
I have been using the extjs framework ( I haven't see this library and what is this marvelous extjs ? where does it leave ? ie : seen that http://www.extendersamples.qsh.eu/ -> 886 KB (1252 KB uncompressed) just for a table :-( |
|
or ... what is supposed to be a impla example of a kind of plugin : http://www.siteartwork.de/livegrid_demo/ --> 1154 KB :-( :-( (just to sort a table ?) |
#4
| |||
| |||
|
|
SAM wrote: Faisal Vali a écrit : Are there any guidelines people use that help them decide when it is better to dynamically generate all html elements using javascript versus actually writing some html and using it as scaffolding? The only way is to code : - all in html, eventually with css, exceptionally with few images - adding JS for some non really useful dynamism, not more Perhaps not the *only* way to code, but certainly a sensible set of principles to begin with. |
|
ie : seen that http://www.extendersamples.qsh.eu/ -> 886 KB (1252 KB uncompressed) just for a table :-( |
|
[...] I went to the site and saw 962KB (as reported by Firebug). I thought: well it must be mainly in the graphics... not so: HTML: 22KB CSS: 207KB JS: 705KB Images: 15KB XHR: 15KB Jinkies! or ... what is supposed to be a impla example of a kind of plugin : http://www.siteartwork.de/livegrid_demo/ --> 1154 KB :-( :-( (just to sort a table ?) And, if I may: Yowser! |
#5
| |||
| |||
|
|
However, as for the scripts the footprint could have been considerably smaller if a competent person would have written it (or the code generating it). For example, the code in the ExtJs example includes [...] Sys.WebForms.EndRequestEventArgs.prototype = { get_dataItems: Sys$WebForms$EndRequestEventArgs$get_dataItems, get_error: Sys$WebForms$EndRequestEventArgs$get_error, get_errorHandled: Sys$WebForms$EndRequestEventArgs$get_errorHandled, set_errorHandled: Sys$WebForms$EndRequestEventArgs$set_errorHandled, get_response: Sys$WebForms$EndRequestEventArgs$get_response } With `Sys$WebForms$EndRequestEventArgs$get_dataItems' aso. being references to previously declared local functions. A function expression would have gotten rid of this bloat and could have probably been used without regret, being supported since JavaScript 1.3 (NN3), JScript 3.0 (IE 4), [...] ^^^[1] ^^^^[2] |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
Websites / DOM based programs that run in a browser: 2 different things! |
#8
| |||
| |||
|
|
While I second that JS *normally* should only be used sparce, non obtrusive, etc and all, I really think there is a place for a comprehensive framework like ExtJS and others. It is, IMHO, a fairly extensive framework that allows making responsive, webbased *programs*. What I mean, is that one should not rely on JS for frontend *websites*, but 'ajaxified' websites go beyond HTML and become more or less *programs*. I wouldn't mind using these tools on an intranet. |
#9
| |||||
| |||||
|
|
Whatever your curious way of emphasizing words, Just wanted to make a difference between *websites* and *programs* |
|
you seem to have missed the point of this subthread and specifically of my posting entirely (to which you posted a followup, after all), which was how to write code so that it does not require this much of data to be downloaded and still does what it is supposed to do. |
|
(I presume you meant Local Area Network instead which is not the same thing) or on the local host. |
|
Obviously, the more data needs to be transferred, stored, and interpreted, the slower and more unresponsive the Web application will be (even with XHR). For a LAN with a rather limited data rate as compared to its supposed number of users this also means: the greater the overall network load will be, therefore the slower the overall network response will be. |
|
For the local host this also means: the more system resources are consumed by the Web application and the user agent it must run in, and the more unresponsive other applications will become. |
#10
| ||||||
| ||||||
|
|
Whatever your curious way of emphasizing words, Just wanted to make a difference between *websites* and *programs* |
|
you seem to have missed the point of this subthread and specifically of my posting entirely (to which you posted a followup, after all), which was how to write code so that it does not require this much of data to be downloaded and still does what it is supposed to do. No, I did not. I think many people define download size as html + js + css. They completely forget that most of the traffic is caused by images and other media. I personally think that any framework used for *programs* is small enough to be 'bundled' with them. |
|
(I presume you meant Local Area Network instead which is not the same thing) or on the local host. No, an intranet is a *collection of LAN's*, with local (non internet) domain names, which from a users point of view acts like a small 'internet'. |
|
For the local host this also means: the more system resources are consumed by the Web application and the user agent it must run in, and the more unresponsive other applications will become. I wonder if you've ever used a framework like ExtJS/DoJo e.o., because it definitely is *not* unresponsive, slow or anything like that. |
|
[Web 2.0 marketing speech] |
|
Are you going to build everything these frameworks offer (sortable- live grids/tree's/form validation/resizable frames/etc) from scratch, just to squeeze out a few kB's? |
![]() |
| Thread Tools | |
| Display Modes | |
| |