Results 1 to 2 of 2

Thread: Include on <head>

  1. #1
    Join Date
    Jan 2007
    Posts
    58
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default Include on <head>

    Hello, i was wondering if there's a way to place all the javascripts on a separated file and then include it on index <head>. Like this:

    <head>
    <?php

    include("folder/javascripts.php");
    ?>

    </head>

    Thanks you.

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    why not just hard code it into your html file?

    Code:
    <script type="text/javascript" href="SCRIPT_NAME.js"></script>
    however yes you can do it the way that you have there if you so please.

    1 other way to look at this all is that you can put each script into a separate file ending with the .js extension, and use the javascripts.php file which you can then determine which of the scripts to include and which are not necessary

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
  •