Closed Bug 231003 Opened 21 years ago Closed 21 years ago

JavaScript

Categories

(Core Graveyard :: View Source, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 172947

People

(Reporter: gopi, Assigned: doronr)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Build Identifier: Mozilla 1.5 Windows 2000 I missed a <img> close tag in a JavaScript function, and when I viewed the page in a 1.5 browser, the browser corrected it, wrongly. The browser added the end tag, but on the next line, replacing a double quote that was part of the original source. It worked fine in Mozilla 1.4, didn't try to make any corrections to the original code and displayed the img. Following are the source of the javascript function, both the original, and the one altered by the browser. I marked the two lines of code in question with ------> Original Source: ------------------ function CoverageMapPopUp(inString) { var inStr; var evnt; var isNav = (navigator.appName.indexOf("Netscape") != -1); var isIE = (navigator.appName.indexOf("Microsoft") != -1); inStr = "/phone_services/coverage/images/" + inString +".gif"; dServiceTPopup = window.open("", "console", "width=660,height=580,resizable,scrollbars"); dServiceTPopup.document.writeln(" <html> "); dServiceTPopup.document.writeln(" <head> "); dServiceTPopup.document.writeln(" <title>map</title> "); dServiceTPopup.document.writeln(" <body> "); dServiceTPopup.document.writeln(" <form name='f1'> "); dServiceTPopup.document.writeln(" <table>"); dServiceTPopup.document.writeln(" <tr><td>"); -----> dServiceTPopup.document.writeln(" <img src=\"" + inStr + "\" border='0' alt='Map' width=660 height=550"); -----> dServiceTPopup.document.writeln("</td></tr>"); dServiceTPopup.document.writeln("<tr>"); dServiceTPopup.document.writeln("<td>"); dServiceTPopup.document.writeln(" <a href='javascript:window.print()'><img src='/images/btn_print.gif' width='93' height='36' border='0' alt='Print'></a>"); dServiceTPopup.document.writeln(" <a href='javascript:window.close()'><img src='/images/btn_close.gif' width='93' height='36' border='0' alt='Close'></a>"); dServiceTPopup.document.writeln("</td>"); dServiceTPopup.document.writeln("</tr>"); dServiceTPopup.document.writeln(" </table>"); dServiceTPopup.document.writeln(" </form> "); dServiceTPopup.document.writeln(" </body> "); dServiceTPopup.document.writeln(" </html> "); dServiceTPopup.document.close(); dServiceTPopup.focus(); } Source that's displayed on browser: ---------------------------------- function CoverageMapPopUp(inString) { var inStr; var evnt; var isNav = (navigator.appName.indexOf("Netscape") != -1); var isIE = (navigator.appName.indexOf("Microsoft") != -1); inStr = "/phone_services/coverage/images/" + inString +".gif"; dServiceTPopup = window.open("", "console", "width=660,height=580,resizable,scrollbars"); dServiceTPopup.document.writeln(" <html> "); dServiceTPopup.document.writeln(" <head> "); dServiceTPopup.document.writeln(" <title>map</title> "); dServiceTPopup.document.writeln(" <body> "); dServiceTPopup.document.writeln(" <form name='f1'> "); dServiceTPopup.document.writeln(" <table>"); dServiceTPopup.document.writeln(" <tr><td>"); -----> dServiceTPopup.document.writeln(" <img src=\"" + inStr + "\" border='0' alt='Map' width=660 height=550"); -----> dServiceTPopup.document.writeln(></td></tr>"); dServiceTPopup.document.writeln("<tr>"); dServiceTPopup.document.writeln("<td>"); dServiceTPopup.document.writeln(" <a href='javascript:window.print()'><img src='/images/btn_print.gif' width='93' height='36' border='0' alt='Print'></a>"); dServiceTPopup.document.writeln(" <a href='javascript:window.close()'><img src='/images/btn_close.gif' width='93' height='36' border='0' alt='Close'></a>"); dServiceTPopup.document.writeln("</td>"); dServiceTPopup.document.writeln("</tr>"); dServiceTPopup.document.writeln(" </table>"); dServiceTPopup.document.writeln(" </form> "); dServiceTPopup.document.writeln(" </body> "); dServiceTPopup.document.writeln(" </html> "); dServiceTPopup.document.close(); dServiceTPopup.focus(); } Reproducible: Always Steps to Reproduce: 1. create a page with the above function(CoverageMapPopUp()) in it 2. in the body, have a button that calls the CoverageMapPopUp() function 3. click on the button Actual Results: nothhing happens Expected Results: open a popup
Attached file Testcase (deleted) —
I get a popup just fine. The source viewer is a little confused, but that's known.
Assignee: general → doronr
Component: JavaScript Engine → ViewSource
Summary: JavaScript → JavaScript
*** This bug has been marked as a duplicate of 172947 ***
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → DUPLICATE
Product: Browser → Seamonkey
Product: SeaMonkey → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: