T
TonyV
Hi all,
I'm trying to use some javascript code in Internet Explorer 6.0 that's
being generated by a Perl file. I have a line in my header that looks
something like this:
<script src="jscode.pl?parm1=foo&parm2=monkey" type="text/javascript" /
Just for the sake of simplicity, here's a very simplified version of
the Perl code:
print "Content-Type: text/javascript; charset=ISO-8859-1\n\n";
print "alert('Testing, 1-2-3!');\n";
The Perl code returns a header with mime type text/javascript. (I've
tried application/javascript to no avail.) Everything works great in
Firefox, and I get a message box that says "Testing, 1-2-3!" that pops
up when I load the page. However, in Internet Explorer 6.0, even
though the results of pulling up the URL manually looks great, the
code isn't executing. No message box, no errors, no nothing. It's
silently dying.
I think the problem is that Internet Explorer is seeing the .pl
extension and thinking, "Hmm, that's not a Javascript file!" and
bypassing it. It might have something to do with this:
http://msdn2.microsoft.com/en-us/library/ms775148.aspx
Does anyone know if there's anything I can do to get a Perl script to
be read by Internet Explorer as a legitimate javascript file? Is
there something special I have to do on the server (IIS 6.0 on Win2k3
Server)? Or is it just plain not possible?
I'm trying to use some javascript code in Internet Explorer 6.0 that's
being generated by a Perl file. I have a line in my header that looks
something like this:
<script src="jscode.pl?parm1=foo&parm2=monkey" type="text/javascript" /
Just for the sake of simplicity, here's a very simplified version of
the Perl code:
print "Content-Type: text/javascript; charset=ISO-8859-1\n\n";
print "alert('Testing, 1-2-3!');\n";
The Perl code returns a header with mime type text/javascript. (I've
tried application/javascript to no avail.) Everything works great in
Firefox, and I get a message box that says "Testing, 1-2-3!" that pops
up when I load the page. However, in Internet Explorer 6.0, even
though the results of pulling up the URL manually looks great, the
code isn't executing. No message box, no errors, no nothing. It's
silently dying.
I think the problem is that Internet Explorer is seeing the .pl
extension and thinking, "Hmm, that's not a Javascript file!" and
bypassing it. It might have something to do with this:
http://msdn2.microsoft.com/en-us/library/ms775148.aspx
Does anyone know if there's anything I can do to get a Perl script to
be read by Internet Explorer as a legitimate javascript file? Is
there something special I have to do on the server (IIS 6.0 on Win2k3
Server)? Or is it just plain not possible?