Click to See Complete Forum and Search --> : No external js on Windows 2003 server


jrotondo
09-12-2003, 10:13 AM
Hello,

I'm moving my sites from a previous host to my
new server, and I've run into a very confusing
problem. It seems that javascripts will only run if
they are embedded within the HTML page. If they
reference an external .js file, they don't run!

For instance, if I have <script>document.write(Date()+".")</script> within my
page, it works... but if I have that script as an
external file and then reference it like so...

<script language="javascript" src="date-script.js"></script>

...it doesn't work anymore! I know it's not my script
because it works just fine on the server I'm trying
to migrate from.

Does anyone have any bright ideas on this? I'm
stumped! Any help is greatly appreciated!

Thanks,
John

requestcode
09-12-2003, 10:19 AM
Have you check with your new host to see if they are restricting there use? Seems a tad paranoid if they are. If they worked on your previous hosts servers then they should work on the new ones unless the the host has set something to keep them from being used. Also if you are going from a Unix environment to a Windows environment there are some subtle differences in how you specify directories. Are your scripts in a separate directory than the HTML docs? If they are you might try placing them in the same directory and see if they work. Good luck.

jrotondo
09-12-2003, 10:35 AM
Well, it's a dedicated Windows 2003 Server (migrating from a Win2K), so I have complete access to the machine. This is not managed hosting, so they have a hands-off approach. They claim there should be nothing to stop it.

I'm guessing it's something in my IIS6 configuration, but I'm at a loss....:confused:

John

jrotondo
09-12-2003, 12:57 PM
Ah! I figured it out!

IIS6 was appending a footer file to all pages being loaded, so my external .js files were becoming HTML files (and creating syntax errors).

Just thought this may be helpful for others out there to know...

John