Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    36
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Script simplification

    Please help me to simplify this script:


    <script language="JavaScript" src="file1.js"></script>
    <script language="JavaScript" src="file2.js"></script>
    <script language="JavaScript" src="file3.js"></script>


    into something like this:

    <script language="JavaScript" src="file1.js", src="file2.js", src="file3.js", ></script>

    thank you

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    frankfurt, german banana republic
    Posts
    1,848
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You can't expect to rewrite the rendering mechanism of browsers - you'll have to include an external javascript file as usual, because this way is sort of standardized.

    You can also put all external code together into one file and only include this if that suits your purpose. For me, that would be slightly confusing.

    Alternatively, you can write the external files dynamically with javascript:

    for (var i = 1; i < 4; i++) {
    document.write('<script language="JavaScript" src="file1.js"><\/script>');
    }


  •  

    Posting Permissions

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