How to include JS file in one line

Discussion in 'JavaScript' started by KEEP IT REAL, Jan 22, 2010.

  1. #1
    I have about 10 JS file
    to include them i use right now
    <script type="text/javascript" src="script.js"></script>
    HTML:
    and so on for each other, but that makes huge list and i don't like it

    Is there a way to include all file in one line of code
    ie:
    <script type="text/javascript" src="http://site.com/folder/script|jquery|prototype|extjs"></script>
    HTML:
    Digg have done that way
    <script src="http://cotnet.diggstatic.com/js/loader/370/JS_Libraries,jquery|Class|analytics|lightbox|label|jquery-dom|jquery-cookie" type="text/javascript"></script>
    HTML:

     
    KEEP IT REAL, Jan 22, 2010 IP
  2. kipdlid

    kipdlid Member

    Messages:
    144
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #2
    You can use a php page to do it but I cant think of any way to do it in javascript.
    if you convert it to php page you can create a separate files with the list of javascripts and then include them in a php page like this
    <?php include 'javascripts.php'; ?>
    the javascript.php will be
     
    kipdlid, Jan 22, 2010 IP