Click to See Complete Forum and Search --> : External JS File Problem


Marcelo
11-12-2003, 11:21 AM
My problem is the following:

- I use IIS under Windows 2000 Server and the service packs are updated.
- I have an asp file that links a .js file.

<script language="Javascript" src="../../funcoes.js"></script>

- When I open the file from my machine (using an editor), it's ok.
- When I open the file from the browser (http://www.x.com/funcoes.js) it comes with a lot of garbage. Some asp codes comes inside the .js file, so when I open the page it returns a "syntax error".
- I Tried to put the scripts inside the asp file and it's ok, the problem only occurs when it's on a external .js file.
- If I'm using apache I can't put the file in the cgi-bin folder, but in this case it's a IIS under Windows 2000.
- I can't reinstall the IIS now because it belongs to a costumer.
- This problems is really a "big problem"...

Thanks for any help.

soccer362001
11-12-2003, 11:41 AM
Change this <script language="Javascript" src="../../funcoes.js"></script>

to this
<script type="text/javascript" src="funcoes.js"></script>

Marcelo
11-12-2003, 12:08 PM
I also tried it...

The problem isn't in the way of linking the file, because the error also occurs when I access the file with the absolute address. (eg http://www.x.com/x.js)