472,779 Members | 1,965 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,779 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 1806
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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.