Closed Bug 30899 Opened 25 years ago Closed 25 years ago

JS library access denied to every second html file opened in child window.

Categories

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

x86
All
defect

Tracking

()

VERIFIED DUPLICATE of bug 29370

People

(Reporter: desale, Assigned: vidur)

References

()

Details

If we try to continously open html files in one child window. [Assuming every html file accesses some functions in predefined JS library], then for second html file JS library access is denied. Or second html file could not find functions in JS library. DESCRIPTION: For example, If we have one Main html file [Call it "main.html"], and it opens three html files [call these, "test1.html", "test2.html", & "test3.html"] in child window one by one. All three "test1,2,3.html" files call javascript functions from JS library. [Call it "donothing.js"] Now problem is first file test1.html could easily call javascript functions defined in JS library, but when it comes to second file, it could not find those functions. [We are calling same functions on both the files and JS library pathis also set exactly same way.] BUILDS: 2000-03-07. STEPS TO REPRODUCE: 1] Please visit above specified URL with above specified builds as well as 4.x. [This opens one child window which loads three files in a row. All these three files access javascript function to load next file. At second file you'll see alert that it could not find function "opennewtest()"] 2] Compare actions on 4.x as well as mozilla. EXPECTED RESULTS: Child window should load third file too which is "test3.html". and your screen should show "You are at TEST3.HTML". ACTUAL RESULTS: After loading test2.html we get alert saying it could not find function "opennewtest()" to load next file. [Problem is how come it found this function first time at test1.html. and not second time at test2.html] You could either visit above URL, or you could set your own testing environment with files I'm attaching. MAIN FILE[main.html] START: <HTML> <HEAD> <TITLE>JS Lbrary acess test</TITLE> </HEAD> <BODY> This page opens threetests in same window, one after another. <SCRIPT> var a = new Array() a[0] = 'test1.html'; a[1] = 'test2.html'; a[2] = 'test3.html'; a.sort(); var tcnum=0; var numfiles=a.length; openTC() function openTC() { if(tcnum != numfiles) { url = 'http://bubblegum/desale/ngdriver/tests/'+a[tcnum]; testWin = window.open(url, 'testWindow'); testWin.opener = self; testWin.focus(); tcnum++; } } </SCRIPT> </BODY> </HTML> MAIN FILE[main.html] END: In above file you'll need to change value of variable "url" if you set up your own testing enviornment. TEST1 FILE [test1.html] START: <HTML> <HEAD> <TITLE>test1.html</TITLE> <SCRIPT TYPE="text/javascript" SRC="../donothing.js"> </SCRIPT> </HEAD> <BODY bgcolor="#0cafe0" text="#cafe00" onLoad="donothing();"> This is <big>Test: 1</big> <SCRIPT TYPE="text/javascript"> opennewtest(); </SCRIPT> </BODY> </HTML> TEST1 FILE [test1.html] END: TEST2 FILE [test2.html] START: <HTML> <HEAD> <TITLE>test2.html</TITLE> <SCRIPT TYPE="text/javascript" SRC="../donothing.js"> </SCRIPT> </HEAD> <BODY bgcolor="#0cafe0" text="#cafe00" onLoad="donothing();"> This is <big>Test: 2</big> <SCRIPT TYPE="text/javascript"> opennewtest(); </SCRIPT> </BODY> </HTML> TEST2 FILE [test2.html] END: TEST3 FILE [test3.html] START: <HTML> <HEAD> <TITLE>test3.html</TITLE> <SCRIPT TYPE="text/javascript" SRC="../donothing.js"> </SCRIPT> </HEAD> <BODY bgcolor="#0cafe0" text="#cafe00" onLoad="donothing();"> <SCRIPT TYPE="text/javascript"> document.write('You are at TEST3.HTML'); </SCRIPT> </BODY> </HTML> TEST3 FILE [test3.html] END: JS LIBRARY [donothing.js] START: /****************************************************************************** * Function: donothing() * * Descript: does Nothig * Returns: null *****************************************************************************/ function donothing(){ var x, y = 5; x = y; } /****************************************************************************** * Function: opennewtest() * * Descript: Opens New test file. * Returns: null *****************************************************************************/ function opennewtest(){ window.opener.openTC(); } JS LIBRARY [donothing.js] START: Hope this all informations helps. If you need any more info, please ask me.
Priority P1.
Keywords: beta1, dogfood
Priority: P3 → P1
this looks like a dupe of bug 29370
Blocks: 11349
Resolving as dupe of 29370, per vidur. *** This bug has been marked as a duplicate of 29370 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
No longer blocks: 11349
Yes. Marking Verified as a dup.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.