473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

FAQ Topic - How do I communicate between frames in a web browser?

-----------------------------------------------------------------------
FAQ Topic - How do I communicate between frames in a web
browser?
-----------------------------------------------------------------------

To reference another frame, you simply need to step through the
frame hierarchy: « parent » is the page the frame is defined
in, « parent.framename » is another frame in the same frameset.
To access a variable called Moomin in a frame called Snork you
would use « parent.Snork.Moomin ». To call the function Snufkin
in that frame you would use « parent.Snork.Snufkin() ».
===
Postings such as this are automatically sent once a day. Their
goal is to answer repeated questions, and to offer the content to
the community for continuous evaluation/improvement. The complete
comp.lang.javascript FAQ is at http://jibbering.com/faq/index.html.
The FAQ workers are a group of volunteers.

Feb 14 '07 #1
2 1830
FAQ server wrote on 14 feb 2007 in comp.lang.javascript:
To reference another frame, you simply need to step through the
frame hierarchy: « parent » is the page the frame is defined
[..]

Shouldn't that be:

window.parent [just parent for short]

?

In general the FAQ should show complete references like:

document.location.href = '...'

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 14 '07 #2
VK
In general the FAQ should show complete references like:
document.location.href = '...'
window.location.href = "..."

document.location should not be used for assignment.
That is one of exceptions to simply memorize to speak the language
properly:

parent-parents but child - children (English language)

return false to prevent default action - but return true to prevent
default action for
1) onerror, 2) onmouseover (for status change), 3) omouseout (for
status change)

read property either from window.location or document.location - but
change property
only over window.location

As any historical exception each one has its own explanation which
modern speaker should not be bothered with. For the curious ones - and
skipping on English exceptions :-) -

onerror and status bar change are among the first handlers with pre-
historic event model in mind which is gone long ago except these. In
that model the logic was pretty much reversed against the current one.
Currently:
- Proceed with default action?
- No (false)

Pre-historic one:
- Prevent default action?
- Yes (true)

With location object historically (DOM 0) it was implemented for both
window and document objects but it was read/write for window and read-
only for document. The original intent of it is a bit obscure.
Possibly it reflects early ideas of how to implement multi-document
display - which is later went by other way to become frames. Unlike
handlers exception this one is almost gone out of use so on many
modern UAs document.location is write-allowed as well. Still there are
UAs following the old grammar, one of them is Safari.
This way a modern speaker should always use window.location form and
never document.location to be properly understood by everyone.

Feb 15 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

40
by: JohnnyCJohnny | last post by:
Is it pretty safe to say that almost all web surfers now use browsers that are Frames compatible? What are most people using these days? IE? Thanks
4
by: abracad | last post by:
Is it possible for a browser to support Javascript but not frames? If so, is it possible to use Javascript to test if a browser can support frames? Thanks
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I communicate between frames in a web browser?...
6
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - Why doesn't the global variable "divId" always refer to the element with id="divId"?...
5
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the text in the url/location bar?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.