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

Discussion in 'Javascript' started by joe, Apr 15, 2008.

  1. joe

    joe Guest

    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?
     
    joe, Apr 15, 2008
    #1
    1. Advertising

  2. joe

    blechler Guest

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

    On Apr 15, 1:49 pm, 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?


    That's fine.
     
    blechler, Apr 15, 2008
    #2
    1. Advertising

  3. joe

    Tom Cole Guest

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

    On Apr 15, 1:49 pm, 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?


    Sure. Just make sure that your multiple scripts don't share any
    'global' variables, unless that's your intention.
     
    Tom Cole, Apr 15, 2008
    #3
  4. Re: Multiple <script type="text/javascript" src="mys.js"></script>OK?

    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.
     
    Jeremy J Starcher, Apr 15, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve Richter

    <txt src= ...> equivalent of <img src= ...>

    Steve Richter, Feb 8, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    2,177
    Laurent Bugnion
    Feb 9, 2006
  2. Greg Johnson
    Replies:
    4
    Views:
    3,139
  3. Replies:
    1
    Views:
    1,674
    Alex Hunsley
    Mar 23, 2007
  4. pheadxdll
    Replies:
    16
    Views:
    3,884
    Neredbojias
    Jun 6, 2007
  5. David D.
    Replies:
    8
    Views:
    290
    McKirahan
    Jan 21, 2005
Loading...

Share This Page