We have an application that has been running on IIS4 and IIS5 for
quite some time, without problem We're now migrating to IIS6
(windows/2003), and have run into a what might be a Javascipt
problem/question, or might be an IIS issue...
The snippet of code in question is:
<script language="JavaScript"><!--
document.write("<script src='/fp/"+includename+"'></script>");
// -->></script>
The included filename is a variable, and does not have a .js
extension. It points to a filename among several thousand files. The
included files ARE javascript files, and contain nothing but
javascript.
This code works fine in IIS4 and IIS5. But when moving to IIS6, the
<script> statement is ignored (because the includename does not end
with .js). If (as a test), I do add a .js on the end of the
includename in the script statement (and create a matching include.js
file), then things work fine.
Our problem is we cannot rename the thousands of files to .js
extensions (they are produced and used by other processes, and the
filename changes would mean more changes in these systems).
I've tried specifying the language, and the type, in the script
statement, but it does not make a difference:
<script language="JavaScript"><!--
document.write("<script language='JavaScript' type='text/javascript'
src='/fp/"+includename+"'></script>");
// -->></script>
It still ignores the <script> statement.
I'm not sure if this is an IIS6 issue, or a Javascript issue. Is
there some way to tell IIS6 to accept the included filename in the SRC
statement as Javascript (as worked in IIS4/IIS5), knowing that the
files do not end in .js?
Thanks for your thoughts.