Javascript performance issue
I've built a top menu based on superfish, but the amount of displayed items in the menu is huge. And ther开发者_Python百科e is also alot of jquery on the top menu. Now to the problem, everytime I load any page that has the menu, the browser(ie7) feels like it looks it locks it self for about 1-2 seconds while the page is being loaded. I'm sure that the top menu is the issue, and I would like to improve the performance of the page.(besides removing the menu and removing the menu items) I've used firebug to see which calls take most of the times, and I the calls are standard jquery or superfish. The top menu is a ascx control. Are they any good ways to let the page load first and the menu later or any other goods ideas to improve the performance?
Have you tried moving all of your script code (Javascript, jQuery) to the bottom of the page, just before the </html>
tag?
Have you ever considered loading the menu just once? We had the same kind of problem not long ago where the menu was being reloaded every time the page refresh.
What we did was we minimized page refreshes and force most of our pages to submit/retrieve data via $.ajax
.
We only refresh the page when it is absolutely necessary.
精彩评论