Michael Shutt
05-30-2001, 12:54 PM
I am trying to create a new document window thru jscript and am running into
a problem adding a cached script tag to the document.
For example, the following javascript is called from a browser window:
function Test()
{
var oWindow = window.open("", "_blank");
oWindow.document.open();
oWindow.document.writeln("<html><head></head>");
oWindow.document.writeln("<scr" + "ipt language=\"JScript\"
src=\"Test.js\">");
oWindow.document.writeln("</scr" + "ipt>");
oWindow.document.writeln("<body>This is a test</body></html>");
oWindow.document.close();
}
This script should load a new browser window that contains an html document
which contains a script tag with a src element (a cached script). But, I am
having problems. I have found the following to be true:
1.) If I embed the script directly (don't use the src attribute), the window
loads correctly.
2.) If I use the src attribute, the window sometimes hangs and never
renders.
a.) If I am accessing the web server locally (a LAN connection), it hangs
about 10% of the time.
b.) If I am accessing the web server remotely (a dialup connection), it
hangs 100% of the time.
3.) If the newly opened window hangs, so does its opener (the window that
contains the test() function).
3.) I can tell from the server log that the new window requests the test.js
file from the server before it hangs.
4.) All of this is the same for IE5.01 and IE5.5 on Windows98 and Win2K.
Has anyone else seen this and/or know what might be going on?
--
Michael Shutt
Please respond to newsgroup as I will not return direct emails.
a problem adding a cached script tag to the document.
For example, the following javascript is called from a browser window:
function Test()
{
var oWindow = window.open("", "_blank");
oWindow.document.open();
oWindow.document.writeln("<html><head></head>");
oWindow.document.writeln("<scr" + "ipt language=\"JScript\"
src=\"Test.js\">");
oWindow.document.writeln("</scr" + "ipt>");
oWindow.document.writeln("<body>This is a test</body></html>");
oWindow.document.close();
}
This script should load a new browser window that contains an html document
which contains a script tag with a src element (a cached script). But, I am
having problems. I have found the following to be true:
1.) If I embed the script directly (don't use the src attribute), the window
loads correctly.
2.) If I use the src attribute, the window sometimes hangs and never
renders.
a.) If I am accessing the web server locally (a LAN connection), it hangs
about 10% of the time.
b.) If I am accessing the web server remotely (a dialup connection), it
hangs 100% of the time.
3.) If the newly opened window hangs, so does its opener (the window that
contains the test() function).
3.) I can tell from the server log that the new window requests the test.js
file from the server before it hangs.
4.) All of this is the same for IE5.01 and IE5.5 on Windows98 and Win2K.
Has anyone else seen this and/or know what might be going on?
--
Michael Shutt
Please respond to newsgroup as I will not return direct emails.