Results 1 to 8 of 8

Thread: Combining multiple javascript calls in header

  1. #1
    Join Date
    Jan 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Combining multiple javascript calls in header

    I have numerous pages on several sites with multiple javascript calls that reference external javascripts (meaning not appearing on the same page). I've tried to find info about combining multiple js references, but for some reason, clear info about how to do this is not readily found.

    If anyone can point me in the right direction, I'm grateful.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I don't understand what you mean.

    You cannot include more than one js file in an src tag. (if that's what you mean)...
    Jeremy | jfein.net

  3. #3
    Join Date
    Jan 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    No, I don't mean to put them within one src. I was thinking there must be another way to include multiple .js references in a single html call, for example with semicolons separating the src's? I thought I'd seen that done before.

  4. #4
    Join Date
    Dec 2008
    Location
    Nigeria
    Posts
    95
    Thanks
    3
    Thanked 8 Times in 8 Posts

    Default

    I havent seen that anywhere before - however if your question is how to purely include multiple javascript reference.....that would be more straight forward.
    The only closest thing to that in my library will be

    <script language="javascript" src="jscript.php?script1.js;scrip2.js;www.google.com/js1.js;www.yahoo.com/js2.js"></script>

    In this case, the call is made through a php script which will simply download the specified urls, concatenate them and output the whole script like a single javascript file, and outputs them with the header('content-type:application/x-javascript');

    I am wondering if that is what you are looking for?

  5. #5
    Join Date
    Jan 2008
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes, that could be it, and thanks sincerely for your time.

  6. #6
    Join Date
    Sep 2008
    Posts
    119
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    Please don't forget that some people ask to include recognition for their scripts in comments. These need to be called independently to respect the programmer's wishes.

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Falkon303 View Post
    Please don't forget that some people ask to include recognition for their scripts in comments. These need to be called independently to respect the programmer's wishes.
    Not really. A script credit or credits may be placed in the page's source code independent of any script call(s).
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. The Following User Says Thank You to jscheuer1 For This Useful Post:

    Falkon303 (02-04-2009)

  9. #8
    Join Date
    Sep 2008
    Posts
    119
    Thanks
    13
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    Not really. A script credit or credits may be placed in the page's source code independent of any script call(s).
    SO good to know! I'll keep em by the scripts only because when it said "do not edit" my paranoid brain considered location a factor as well.

    hah!

    - Ben

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •