views:

38

answers:

1

Hello, I have a site with menu, which reloads content. Content is dynamically loadable, using ajax and php-script. At different content pages I need in different jquery-plugins. But If I'm writing including need plugin directly in some content page, I get a big lags during loading. So, now I'm includgin all plugins into main page... And it's not the best idea... Any suggestion?


UPD: I have a div with content. Content is shown with effects (rolling up/down). When part of menu is clicked, I'm sending ajax-responce to the php script, which reads need text from database and returns it to the main page, from which I sent the responce. Than I'm pasting that content into a div and roll id down.

So I'll include jquery-plugins in content pages, the animation of rolling will'nt be normal.

A: 

Including all plug-ins in a single JS file in the main page will minimize your HTTP requests, so it is the best idea from an overall performance standpoint.

On the other hand, loading plug-ins only when they are needed would improve your initial page load. It sounds like you are doing something similar, though. Can you provide more details on how you're loading the script?

MikeWyatt
Thanks for your reply. I've updated post.
Ockonal