Generated javascript from .pl files



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?

.



Relevant Pages

  • Re: Generated javascript from .pl files
    ... I'm trying to use some javascript code in Internet Explorer 6.0 that's ... being generated by a Perl file. ... I just manually tested IE7 with a .pl extension and it gave me no problems with an external file. ...
    (comp.lang.javascript)
  • Re: cant redirect to Excel
    ... this bu^H^Hfeature,* I don't know how Internet Explorer handles it. ... print $header to get a header for an html page, but with perl we roll ... There is another page the External user sees and I will try ...
    (comp.lang.php)
  • Re: A Lot of Questions from a Noob
    ... Apache, javascript, regex, XML, etc.) I reached the level of ... they work, e.g. Ruby, PERL, Zend, SOAP. ... ASP is a serverside solution. ... Personally I like PHP and/or Perl ...
    (comp.lang.php)
  • Internet Explorer JavaScript insecure function
    ... Product: Microsoft Internet Explorer ... I discovered a javascript function called ... With "file.writeline" function the attacker can ... This code writes a file called "proof.txt" in the hard disk, ...
    (Vuln-Dev)
  • [Full-Disclosure] Internet Explorer JavaScript insecure function
    ... Product: Microsoft Internet Explorer ... I discovered a javascript function called "file.writeline" may be ... An attacker may use this function writting JavaScript code in posts of forums, guestbooks, etc for owning ... this may be potentially dangerous for Internet Explorer users. ...
    (Full-Disclosure)