SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict ornette's Avatar
    Join Date
    Mar 2005
    Location
    Tenerife, Canary Isles
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Newbies simple header question

    hello there,

    I'm not very well up on my javascript, so I hope you will tolerate such a simple question and help me out with it.

    I am trying to set up Lightbox and the 3 scripts that it tells me to put into the header are over 4,000 lines long.

    I took a look at the Source of the Lightbox 2 demo page and it has the following pasted in the header:
    Code JavaScript:
    <script src="js/prototype.js" type="text/javascript"></script>
    	<script src="js/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
    	<script src="js/lightbox.js" type="text/javascript"></script>
    Does that mean that he has the scripts stored in a folder like CSS and when the page loads it calls the scripts? Or should I load all the scripts into the header anyway?

    Thanks for helping out.

  2. #2
    SitePoint Evangelist
    Join Date
    Jul 2007
    Posts
    345
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, the scripts will be loaded in, like external CSS files. For you to do the same it's probably best to download a copy of the files and then add them in a folder on your site. Importing the scripts gives the browser a chance to cache them and allows them to be maintained centrally rather than across many pages.

  3. #3
    SitePoint Addict ornette's Avatar
    Join Date
    Mar 2005
    Location
    Tenerife, Canary Isles
    Posts
    175
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I wondered if that was the case, but as there is no <link> I wasn't sure. Thanks for your quick answer.


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
  •