By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,483 Members | 1,063 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,483 IT Pros & Developers. It's quick & easy.

Diff between the window created by JavaScript and Browser GUI

P: n/a
KC
Hi,

Every JavaScript executive context has a top-level window and
we can use window.open() to open another window ...
Does this related to Windows created by click on "File"->"New Window"
or "File" -"New Tab" in browser's menu bar ?

I think window created by "File"->"New Window" and "File"->"New Tab"
are independent to each other from JavaScript's point of view. Is this
correct ?
Means we can't write JavaScript code and make them talk to each other
via
window.frames[] ... correct ??

I'm confuse by the term "window" or "frame" used in JavaScript books.
Thanks
KC

Dec 11 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a

KC wrote:
Hi,

Every JavaScript executive context has a top-level window and
we can use window.open() to open another window ...
Does this related to Windows created by click on "File"->"New Window"
or "File" -"New Tab" in browser's menu bar ?
Yes, although JavaScript has more control over window size and position
on first open.
>
I think window created by "File"->"New Window" and "File"->"New Tab"
are independent to each other from JavaScript's point of view. Is this
correct ?
Not really. Both create full window objects. It's just how they are
organized on the GUI.
Means we can't write JavaScript code and make them talk to each other
via
window.frames[] ... correct ??
JavaScript can only talk to window objects it creates or is present on
the page. For example a frame can talk to a another frame in the page,
or a window it creates with window.open, but not with a frame on
another page or a window it didn't open.
>
I'm confuse by the term "window" or "frame" used in JavaScript books.
"frame" refers to the HTML frame element which let's multiple pages be
displayed on the same page. The page that contains the frames is a
window object with it's array window.frames filled with the window
objects of the frames.
>

Thanks
KC
I hope that cleared some things up

Dec 12 '06 #2

P: n/a
"KC" <kc*****@gmail.comwrote in comp.lang.javascript:
Hi,

Every JavaScript executive context has a top-level window and
we can use window.open() to open another window ...
Does this related to Windows created by click on "File"->"New Window"
or "File" -"New Tab" in browser's menu bar ?
Technically Javascript at its core knows nothing about windows (as a class
or object).

It knows about documents (with the help of the Document Object Model),
which is why as soon as the window object is instantiated, the document
that is contained by it is created.
I think window created by "File"->"New Window" and "File"->"New Tab"
are independent to each other from JavaScript's point of view. Is this
correct ?
A tab is just another window, although it is contained within the
application frame (as opposed to an HTML-defined frame). You use the name
of the window object (tab) to refer to changes to it, includes its
visibility (likely a z-order parameter in which you change the front-to-
back positions of tabbed windows relative to one another).

Means we can't write JavaScript code and make them talk to each other
via
window.frames[] ... correct ??
Frames are defined by the Frameset specification of HTML, and they
actually divide a window object into different containers, each holding
their own document. A frames property to a window object would be created
by use of the HTML elements that define frames upon document creation, or
dynamically otherwise.

Do not confuse the frames in a window object (an HTML-based construct)
with the tabbed windows that are contained in an application "frame" or
container or enclosure (the application "super" window).

No part of the Javascript core definition even discusses the nature of
frames or windows or tabbed windows. Look to those who created these
extensions to presenting and styling document content to describe them to
you, and with examples. Examples are important: what is the point in
constructing a specification to a language or guideline and not ensuring
that your audience understands it by the use of several examples?
I'm confuse by the term "window" or "frame" used in JavaScript books.
Dec 12 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.