Struggling with an external .js file on localhost

Discussion in 'HTML & Website Design' started by JamieC, Nov 3, 2005.

  1. #1
    Hi all,

    I tend to develop most of my websites on my local machine, which is running Windows XP Pro and IIS.

    I'm strugging with a weird problem at the moment, in that neither Firefox or IE appear to be loading an external .js file for a scroller i've 'aquired'.

    Other external .js files load perfectly.

    The code works perfectly if I embed it in the HTML document, however I want to keep it in an external file.

    The code also works if I upload to a remote webserver and test.

    I've tried disabling my virus scanner (Avast! Antivirus), which has no effect.

    Does anyone have any experience with this issue?
     
    JamieC, Nov 3, 2005 IP
  2. Amsterdam

    Amsterdam Well-Known Member

    Messages:
    361
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #2
    Yes. A while back I wasted a couple of hours with the same problem. Eventually I kicked myself (very hard!) when I realised that the JS was not in the directory I thought it was. Doh!

    T
     
    Amsterdam, Nov 3, 2005 IP
  3. JamieC

    JamieC Well-Known Member

    Messages:
    226
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    138
    #3
    :)

    Unfortunately not the case! (Although I did just check that...)
     
    JamieC, Nov 3, 2005 IP
  4. riz

    riz Peon

    Messages:
    82
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I am assuming that you have checked your relative path to the external file; 123.js is different form /123.js. There is a setting in IIS, in properties of the default website, there is a tab for Home Directory. On this tab, press the button labeled Configuration…, and select the Options tab from the resulting dialogue box. The checkbox labeled Enable parent paths is the one you may need to uncheck.
     
    riz, Nov 3, 2005 IP
  5. JamieC

    JamieC Well-Known Member

    Messages:
    226
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    138
    #5
    Thanks for everyone's comments.

    For the record, I have since resolved this problem by creating a new text file and pasting the code into that, then deleting the old file.

    I can only conclude that perhaps the character encoding of the file was somehow preventing it's being loaded?

    I had originally downloaded the .js file in a zip file from a web site. Don't know if this would have had any effect.

    Cheers,

    Jamie
     
    JamieC, Nov 4, 2005 IP