473,385 Members | 1,356 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,385 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 1825
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?...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...

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.