M
Matthew Flower
I'd like to generate a JavaScript file from a servlet. Mozilla 1.5
seems to have no problem with this, but IE 6.0 is not cooperating.
I've created a very simple test servlet that writes one line:
alert("hello");
I have an HTML page that looks like this:
<html><head>
<script language="javascript" src="/servlet/Test"></script>
</head></html>
If I don't use the page, but instead use the URL for the script
directly from my browser, in Mozilla the page comes up. (Normal
Mozilla behavior - it displays the page rather than loading it.) In
IE, I instead get an error message:
Internet Explorer cannot download Test from localhost
Internet Explorer was not able to open this Internet Site.
The requested site is either unavailable or cannot be found.
Please try again later.
Does anyone have any idea why IE can't display the page? I've tried
using a variety of MIME types (text/javascript, text/JScript,
application/x-javascript) and nothing seems to work. One interesting
note -- if I change the Mime type to text/html, the alert("hello")
will show up if I am using the URL directly.
Has anyone else done this? Please help, I'm out of ideas.
seems to have no problem with this, but IE 6.0 is not cooperating.
I've created a very simple test servlet that writes one line:
alert("hello");
I have an HTML page that looks like this:
<html><head>
<script language="javascript" src="/servlet/Test"></script>
</head></html>
If I don't use the page, but instead use the URL for the script
directly from my browser, in Mozilla the page comes up. (Normal
Mozilla behavior - it displays the page rather than loading it.) In
IE, I instead get an error message:
Internet Explorer cannot download Test from localhost
Internet Explorer was not able to open this Internet Site.
The requested site is either unavailable or cannot be found.
Please try again later.
Does anyone have any idea why IE can't display the page? I've tried
using a variety of MIME types (text/javascript, text/JScript,
application/x-javascript) and nothing seems to work. One interesting
note -- if I change the Mime type to text/html, the alert("hello")
will show up if I am using the URL directly.
Has anyone else done this? Please help, I'm out of ideas.