By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,712 Members | 2,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,712 IT Pros & Developers. It's quick & easy.

Javascript generated html page crashes Explorer, but not Mozilla

P: 1
Hi, if anyone can help with this I'd be very grateful:

I'm generating an html popup window with Javascript. When the popup appears in Explorer 6.0 it is empty and crashes the browser, though it works in Mozilla.

In the generated code I'm linking to a Javascript file "artscripts.js". When I remove this line of code the script works fine (except of course I can't call the javascript functions contained in the linked file).

The first part of the code that generates the popup is as follows:

Expand|Select|Wrap|Line Numbers
  1. function enlarge(theimage)
  2.    {
  3.  
  4.    win2=window.open('','win2','width=600,height=600,location=no,menubar=no,scrollbars=yes,resizable=yes');
  5.    win2.focus();
  6.    win2.document.open();
  7.    win2.document.writeln('<HTML>');
  8.    win2.document.writeln('<HEAD>');
  9.    win2.document.writeln('<meta http-equiv="imagetoolbar" content="no">');
  10.    win2.document.writeln('<TITLE>Enlarged view</TITLE>');
  11.    win2.document.writeln('<script src="artscripts.js" language="JavaScript" language="javascript1.2"></script>');
  12.    win2.document.writeln('<link href="styles.css" rel="stylesheet" type="text/css" />');
  13.    win2.document.writeln('</HEAD>');
  14.    win2.document.write('<BODY id="popupbody">');
Any ideas?

Thanks
Laura
Sep 20 '06 #1
Share this Question
Share on Google+
2 Replies


acoder
Expert Mod 15k+
P: 16,027
Difficult to say without seeing the JavaScript file, but I would remove the language attributes for the script tag. It's deprecated in favour of the type attribute.
May 14 '08 #2

100+
P: 210
Presumably the function does close the HTML.

Expand|Select|Wrap|Line Numbers
  1.  win2.document.writeln('<script src="artscripts.js" language="JavaScript" language="javascript1.2"></script>');
When writing <script> tags they should be closed like this: <\/script>

If that doesn't work you'll need to show more code.
May 14 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.