Closed Bug 88291 Opened 25 years ago Closed 25 years ago

Javascript error due top.LeftMenu.document has no properties

Categories

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

x86
All
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 22681

People

(Reporter: urbanekx, Assigned: pollmann)

References

()

Details

(Whiteboard: [DUPEME])

Attachments

(1 file)

Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:0.9.1+) Gecko/2001062804 Error: top.LeftMenu.document has no properties Source File: http://www.ebanka.cz/menunn.js Line: 254 this is output of JavaScript Console. In IE5 and N4.xx this page work fine. The page is loaded, but left frame for menu is white without content.
Using Mozilla binaries 20010615xx on WinNT, Linux. Confirming bug. OS : Windows ME ---> All. The left frame is defined as follows: <frame name="LeftMenu" src="javascript:top.ResolveBrowsers();" marginwidth etc. The function ResolveBrowsers is as follows: function ResolveBrowsers() { if (allowedBrowser) { top.v_Menu.Show(x1,x2,x3); } else { top.location="BadBrowser.html"; } }
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows ME → All
"allowedBrowser" is resolving to true in Mozilla, so we are driven to the line top.v_Menu.Show(x1,x2,x3); The v_Menu object is defined in the menunn.js file. I'll attach it below -
Attached file menunn.js file —
In the menunn.js file, the error indicated above: Error: top.LeftMenu.document has no properties Source File: http://www.ebanka.cz/menunn.js Line: 254 occurs in this function: function ShowJSMenu(a_menu, a_submenu, a_location) { etc. etc. var v_html = '<HTML>\r\n<HEAD>\r\n' + etc. etc. top.LeftMenu.document.open(); <---------------- ERROR OCCURS HERE top.LeftMenu.document.write(v_html); top.LeftMenu.document.close(); }
So the problem seems to be: if we have a frame with name="LeftMenu" <frame name="LeftMenu" src="javascript:top.ResolveBrowsers();" etc. >, and src="javascript:top.ResolveBrowsers();" is going to do top.LeftMenu.document.(something), is this supposed to work? Apparently it does in NN4.x ... Browser, not engine. Reassigning to DOM Level 0 for further analysis -
Assignee: urbanekx → jst
Component: Javascript Engine → DOM Level 0
QA Contact: pschwartau → desale
Ok, so the reason for this problem is that the script tries to access a frame before the content of the frame is loaded, in this case the content of the frame should be the result of evaluating the javascript: URL. This boils down to our problem with not having a document in frames/iframes before the document in the frame/iframe is loaded, well known problem, I'm sure pollmann has a dupe of this bug, reassigning to pollmann. Thank Phil once again for completely debugging the problem :-)
Assignee: jst → pollmann
dup of at least bug 61468, is the base bug bug 22681?
Whiteboard: [DUPEME]
Marking as dup of bug 22681. If you don't agree, please reopen, thanks! *** This bug has been marked as a duplicate of 22681 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
This again is about frames, not about iframes, isn't it? Maybe this is not a duplicate of bug 22681, but a dupe of bug 61468?
/me thinks fixing one will fix the other... maybe we should mark them dependant instead?.. thanks for pointing it out
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: