Closed
Bug 264760
Opened 20 years ago
Closed 20 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)
when referencing properties/functions of another window using with (windowRef)
{...} all references are resolved with respect to the current window instead of
the other window. Similar to Bug 49213, Bug 38215, etc. Bug exists in Mozilla
1.4-1.8a+
test case coming up.| Reporter | ||
Comment 1•20 years ago
|
||
This window contains function showtitle and variable id.
| Reporter | ||
Comment 2•20 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•20 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•20 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: 20 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•