开发者

Does jquery makes the browser slow?

I'm using 开发者_高级运维jQuery in my web page. Will this make the web page to load contents slow?

Using jQuery is advantage than JavaScript or not why?...


Inspect your page with Firebug and YSlow to see where the bottleneck actually is.

Generally speaking, JS does make your page load slower. However, on modern machines and with modern Internet connection speeds this delay is not even noticeable. However, excessive use of JS can potentially make your page operate slower.


Im using jquery in my web page, will this make the web page to load contents slow.

Depends on the situation, but usually no. If you are planning to use some JavaScript/JQuery to enhance your interface, build in a fading effect or two, have a lookup dropdown or some AJAX calls, don't worry too much. You are very likely to be fine.

Only if you have HUGE web pages (tens of thousands of elements), need to make multi-megabytes AJAX requests, or have a completely JavaScript-driven UI that tends to work slowly, then it's time to look for optimizations.

Check out questions on JQuery and performance on SO to get information on specific situations (lots of selectors, performance comparisons between $() and document.getElementById, etc.)

One thing to be careful with is JQuery (and of course, other Frameworks') plugins that apply manipulations to the whole document when the page loads. A very good example is the source code formatter here on SO. If you look closely, you will notice that when loading a page, there is a tiny fraction of a pause where the source code is not formatted. The formatting is applied using JavaScript. If you use too much of stuff like this, your page is likely to render slowly on older machines.

In general, if you're unsure, always test your pages not only on many browsers, but on older machines, too.


Use the Google Ajax libs hosted version and it'll probably be cached by the time someone gets to your page.


I've found that optimizing the jQuery JavaScript source with Google Closure Compiler has a noticeable effect on both the load time of the JavaScript and the overall response time. It's quite impressive.


There is only a slight overhead when loading the page by adding an additional resource such as a .js file.

For details of a specific loading procedure, use google webmaster tools to get recommndations.

jQuery itself can slow down the browser (not the loading time of the page) when used without caution or on extremely crowded pages, but I wouldn't worry about that in most cases. The recent release of jquery 1.4 has improved performance even further.


At 23KB minified and gzipped, it will not make a noticeable difference in the speed load of your pages (especially once it's cached in your browser). It will also not make a noticeable difference in the interactivity of your page.

You will save a lot of time not having to debug cross browser compatibility issues.


Yes jQuery or any other file that load in your page adds an overhead.

For me that overhead is "0" based on the jQuery effort.

Try programming without jQuery to see my point of view.

jQuery has my vote for president !

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜