Stop Paying Your jQuery Tax
41–50 of 90 posts
Re: Stop Paying Your jQuery Tax
#42Why do you still need a document ready function if all your scripts are loading after the html anyway?
The DOM will have been parsed if your scripts are at the end—but external components (links, imgs) may not have loaded yet.
Re: Stop Paying Your jQuery Tax
#43Please go check out StackOverflow's source code before bandwagoning on this topic. This is shifting blame to the tools. The problem lies on StackOverflow's lacking design and not in jQuery. Pushing jQuery to the bottom of the page is trivial if you do proper HTML architecture. Pages should have only HTML. JS files only JS. JS files referenced at the very bottom of the body. Very simple. (if your asp/c#/* framework do…
Re: Stop Paying Your jQuery Tax
#44Earlier quoted context omitted.
The DOM will have been parsed if your scripts are at the end—but external components (links, imgs) may not have loaded yet.
The same is true whether or not you use a document.ready statement; you're thinking of window.onready, which fires once all images have been downloaded.
Re: Stop Paying Your jQuery Tax
#45Please go check out StackOverflow's source code before bandwagoning on this topic. This is shifting blame to the tools. The problem lies on StackOverflow's lacking design and not in jQuery. Pushing jQuery to the bottom of the page is trivial if you do proper HTML architecture. Pages should have only HTML. JS files only JS. JS files referenced at the very bottom of the body. Very simple. (if your asp/c#/* framework do…
Re: Stop Paying Your jQuery Tax
#46Please go check out StackOverflow's source code before bandwagoning on this topic. This is shifting blame to the tools. The problem lies on StackOverflow's lacking design and not in jQuery. Pushing jQuery to the bottom of the page is trivial if you do proper HTML architecture. Pages should have only HTML. JS files only JS. JS files referenced at the very bottom of the body. Very simple. (if your asp/c#/* framework do…
Re: Stop Paying Your jQuery Tax
#47Earlier quoted context omitted.
true, still verbose, but more elegant than the solution in asp.net mvc
out of sheer curiosity, what is the asp.net mvc solution?
Re: Stop Paying Your jQuery Tax
#48Please go check out StackOverflow's source code before bandwagoning on this topic. This is shifting blame to the tools. The problem lies on StackOverflow's lacking design and not in jQuery. Pushing jQuery to the bottom of the page is trivial if you do proper HTML architecture. Pages should have only HTML. JS files only JS. JS files referenced at the very bottom of the body. Very simple. (if your asp/c#/* framework do…
Let's be clear ... I am not attacking jQuery here, just saying it is misuse to chuck it in the header and offering a practical mechanism to get out of a mess you create. I explain the cost of placing it in the header. I am not perfect, I make mistakes daily, I try to learn.
Re: Stop Paying Your jQuery Tax
#49Earlier quoted context omitted.
Let's be clear ... I am not attacking jQuery here, just saying it is misuse to chuck it in the header and offering a practical mechanism to get out of a mess you create. I explain the cost of placing it in the header. I am not perfect, I make mistakes daily, I try to learn.
You pointed out a few best-practices, but it's a shame that this article is written in the context of jQuery, rather than recognizing that these "taxes" are true with every script tag you place on your website.
Re: Stop Paying Your jQuery Tax
#50Earlier quoted context omitted.
You pointed out a few best-practices, but it's a shame that this article is written in the context of jQuery, rather than recognizing that these "taxes" are true with every script tag you place on your website.
That is absolutely true, was looking at the cnn.com .. http://z.cdn.turner.com/cnn/tmpl_asset/static/intl_homepage/... which is in the header chews up 100k of compressed js. This monster must take upwards of 20ms to parse in chrome as well. Way worse in crappy browsers, the CDN network you need to support this is huge.