By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,676 Members | 1,325 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,676 IT Pros & Developers. It's quick & easy.

Multiple <script type="text/javascript" src="mys.js"></script> OK?

P: n/a
joe
Is it OK to have multiple:

<script type="text/javascript" src="funcs1.js"></script>
<script type="text/javascript" src="funcs2.js"></script>
<script type="text/javascript" src="funcs3.js"></script>

?

And I need to use similarly multiple CSS:

<link href="blah1.css" rel="stylesheet" type="text/css" />
<link href="blah2.css" rel="stylesheet" type="text/css" />

Is that OK too?
Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
On Apr 15, 1:49 pm, joe <m...@invalid.comwrote:
Is it OK to have multiple:

<script type="text/javascript" src="funcs1.js"></script>
<script type="text/javascript" src="funcs2.js"></script>
<script type="text/javascript" src="funcs3.js"></script>

?

And I need to use similarly multiple CSS:

<link href="blah1.css" rel="stylesheet" type="text/css" />
<link href="blah2.css" rel="stylesheet" type="text/css" />

Is that OK too?
That's fine.
Jun 27 '08 #2

P: n/a
On Apr 15, 1:49*pm, joe <m...@invalid.comwrote:
Is it OK to have multiple:

<script type="text/javascript" src="funcs1.js"></script>
<script type="text/javascript" src="funcs2.js"></script>
<script type="text/javascript" src="funcs3.js"></script>

?

And I need to use similarly multiple CSS:

<link href="blah1.css" rel="stylesheet" type="text/css" />
<link href="blah2.css" rel="stylesheet" type="text/css" />

Is that OK too?
Sure. Just make sure that your multiple scripts don't share any
'global' variables, unless that's your intention.
Jun 27 '08 #3

P: n/a
On Tue, 15 Apr 2008 20:49:53 +0300, joe wrote:
Is it OK to have multiple:

<script type="text/javascript" src="funcs1.js"></script<script
type="text/javascript" src="funcs2.js"></script<script
type="text/javascript" src="funcs3.js"></script>

?

And I need to use similarly multiple CSS:

<link href="blah1.css" rel="stylesheet" type="text/css" /<link
href="blah2.css" rel="stylesheet" type="text/css" />

Is that OK too?
As others have said, thats fine.

There is a [small] performance hit for everything on the page that needs
to be downloaded. This includes all graphics, all style sheets, all
javascript files. If you ever run your document through one of those
speed-test programs, it may complain.

In reality, I don't worry about it... but I don't go overboard either.
Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.