Diff between the window created by JavaScript and Browser GUI

K

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
 
B

Benjamin

KC said:
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
 
P

Patient Guy

KC said:
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top