Closed Bug 136796 Opened 23 years ago Closed 23 years ago

calling JS function from opener window results in "The document contains no data"

Categories

(Core :: DOM: Core & HTML, defect, P1)

x86
Windows 95
defect

Tracking

()

VERIFIED DUPLICATE of bug 137965

People

(Reporter: desale, Assigned: jst)

References

()

Details

calling JS function from opener window results in "The document contains no data" [This is what I think is happening, but I dont know the exact cause.] It took me long time to create this minimized testcase, but I still think something is wrong with calling JS function from opener window.] STEPS TO REPRODUCE: 1] Please visit above URL 2] Click button "Start Test". 3] It will open one window loading file "testing3.html" 4] Then file "testing4.html" will be loaded automatically in child window. 5] Observe..After some brief time you will get alert "The document contains no data" EXPECTED RESULTS: We should not get any alert showing "The document contains no data" ACTUAL RESULTS: At the end we get alert showing "The document contains no data". I'm pasting code of all the files used here. CODE START [test5.html] <HTML> <HEADER> <TITLE>Prashant Test</TITLE> </HEADER> <BODY> <SCRIPT> var a = new Array() a[0] = 'testing3.html'; a[1] = 'testing4.html'; var tcnum=0; var numfiles=a.length; function openTC() { if(tcnum != numfiles) { url = 'http://bubblegum/ngdriver/pratesting/testcase/'+a[tcnum]; testWin = window.open(url, 'testWindow'); testWin.opener = self; testWin.focus(); tcnum++; } } </SCRIPT> <h1>Click Button to start test.</h1> <form name="workform"> <input type="button" name="but1" value="Start Test" onClick="openTC()"> </form> </BODY> </HTML> CODE END [test5.html] CODE START [prashant2.cgi] #!/usr/bin/perl use CGI; print "Content-type: text/html\n\n"; print "<script>window.opener.openTC()</script>"; __END__ CODE END [prashant2.cgi] CODE START [testing3.html] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Testing Page</TITLE> </HEAD> <script> <!-- function fixSubmit() { if (window.name == "testWindow") { document.results.submit(); } } //--> </script> <BODY onLoad="fixSubmit();"> <h1>This is Test - 1 </h1> <FORM name="results" action="/ngdriver/cgi-bin/prashant2.cgi" method="post"> <input type="hidden" value="pra" name="hid1"> </FORM> </BODY> </HTML> CODE END [testing3.html] CODE START [testing4.html] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Testing Page</TITLE> </HEAD> <script> <!-- function fixSubmit() { if (window.name == "testWindow") { document.results.submit(); } } //--> </script> <BODY onLoad="fixSubmit();"> <h1>This is Test - 2 </h1> <FORM name="results" action="/ngdriver/cgi-bin/prashant2.cgi" method="post"> <input type="hidden" value="pra" name="hid1"> </FORM> </BODY> </HTML> CODE END [testing4.html] CODE FLOW: 1] once we click button "start Test" on test5.html function openTC() gets called. 2] openTC() opens child window loading "testing3.html". 3] testing3.html submits form to "prashant2.cgi" 4] "prashant2.cgi" calls openTC() function from opener window, which loads "testing4.html". 5] testing4.html submits form to "prashant2.cgi" 6] "prashant2.cgi" calls openTC() function from opener window. At this point there is condition in openTC() function which checks for array length & it should stop execution, but it results in alert showing "The document contains no data" Dont know what is wrong.
Setting Priority to P1. I tested this on Win-95,XP,NT. This is blocking our automation testing.
Priority: -- → P1
Adding nsbeta1 to show up in the radar...
Keywords: nsbeta1
Dup of bug 137965 ? Fix checed in on trunk April 18 (branch Apr. 25) See http://bugzilla.mozilla.org/show_bug.cgi?id=139164#c9
Resolving dupe. *** This bug has been marked as a duplicate of 137965 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.