Closed
Bug 264760
Opened 21 years ago
Closed 21 years ago
JS with window statement does not set scope to another window
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: bc, Unassigned)
Details
Attachments
(2 files)
| Reporter | ||
Comment 1•21 years ago
|
||
This window contains function showtitle and variable id.
| Reporter | ||
Comment 2•21 years ago
|
||
this window also contains function showtitle and variable id. It calls
showtitle in its own window, then attempts to call showtitle in the other
window using with win1 { showtitle() }.
Expected result: each window show a string containing the contents of its own
id variable and title. (MSIE6 does show the expected result)
Actual result: only the window-with.html window shows any output and the
showtitle in window-with.html is called each time.
| Reporter | ||
Comment 3•21 years ago
|
||
wow. strangely enough, MSIE agrees with Mozilla when hosting the pages on
bugzilla, but does not when the pages are hosted locally. Maybe an https issue.
| Reporter | ||
Comment 4•21 years ago
|
||
actually, the problem is the call to showtitle() occurs before the other window
has completed opening. If you change the code to
var win1 = window.open('sub-window.html');
with (win1)
{
setTimeout('showtitle()', 1000);
}
it works in Mozilla. -> INVALID.
Sorry for the spam.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•