Forum Moderators: open

Message Too Old, No Replies

Struggling with an external .js file on localhost

         

JamieCon

2:46 pm on Nov 3, 2005 (gmt 0)

10+ Year Member



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?

garann

7:11 pm on Nov 3, 2005 (gmt 0)

10+ Year Member



What's the path to your .js file? If it's given relative to the root of your webapp, you'll have problems with it on your local machine cause it will look for the file relative to the hard drive's root.

Just a guess. If that's not the problem, maybe post the code you're using to import the script?

JamieCon

1:30 pm on Nov 4, 2005 (gmt 0)

10+ Year Member



Hi,

Thanks for the help. I managed to solve 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