I would highly recommend merging as much as you can into one file.
Each additional request could tack on a couple 100 milliseconds. The
best thing you can do though is to get the latest firebug console
(www.getfirebug.com) and use the 'Net' tab to compare both methods and
see which is better for your situation.

--
Brandon Aaron

On 2/14/07, Kristinn Sigmundsson <[EMAIL PROTECTED]> wrote:
> Hi there.
>
> I'm working on a site that will be using alot of ajax for
> edit-in-place, aswell as alot of other javascript. The thing is that
> there is practicly no javascript for regular users, compared to
> administrators. So I figured that in the top of my indexfile where all
> the scripts are I'd do something like this:
> <?php
> if ($user->getRights('news')
>   echo '<script src="newsScripts.js" type="text/javascript></script>';
> ?>
>
> for every page that needs javascript. The thing is that for this to
> work properly (and without having the same code on different places) I
> have to split some .js files down to each function.
>
> Is this a good idea in the first place, having (at most) up to 10 <script> 
> tags?
> Would it be better to make a big file for all the adminfunctions when
> the development is done (compressed it is abt 20kb, not including
> jQuery and a few plugins).
>
> I kinda the latter better. Then I can have a file that is common.js
> with all my common functions and different scriptfiles for more
> specific stuff. But when the development is done I put them all to one
> adminstration.js file and compress it.
>
> What are your thoughts on this? How do you manage your javascript in a
> development, on a running site?
>
> Would be pleased with every input you make.
> // Kiddi
>
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
>

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to