SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    External JavaScript File

    How would I put this JavaScript into it's own file to use?

    Code:
    <script language="Javascript">
    <!--
    if (document.images) {
    oneup = new Image
    oneover = new Image
    twoup = new Image
    twoover = new Image
    threeup = new Image
    threeover = new Image
    fourup = new Image
    fourover = new Image
    fiveup = new Image
    fiveover = new Image
    sixup = new Image
    sixover = new Image
    
    oneup.src = 'index2stuff/1up.gif'
    oneover.src = 'index2stuff/1over.gif'
    twoup.src = 'index2stuff/2up.gif'
    twoover.src = 'index2stuff/2over.gif'
    threeup.src = 'index2stuff/3up.gif'
    threeover.src = 'index2stuff/3over.gif'
    fourup.src = 'index2stuff/4up.gif'
    fourover.src = 'index2stuff/4over.gif'
    fiveup.src = 'index2stuff/5up.gif'
    fiveover.src = 'index2stuff/5over.gif'
    sixup.src = 'index2stuff/6up.gif'
    sixover.src = 'index2stuff/6over.gif'
    }
    //-->
    </script>
    Thanks
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com

  2. #2
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <script src="blah.js" type="text/javascript"></script>
    In blah.js:

    if (document.images) {
    oneup = new Image
    oneover = new Image
    twoup = new Image
    twoover = new Image
    threeup = new Image
    threeover = new Image
    fourup = new Image
    etc.

  3. #3
    Former Staff Member silver trophy Adam P.'s Avatar
    Join Date
    Apr 2001
    Location
    San Francisco
    Posts
    3,288
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks :-)
    SPF Mentor/Advisor 2001-2003
    SPF Designer of the Year 2002
    SPF Graphic Designer of the Year 2003
    AdamPolselli.com


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
  •