473,407 Members | 2,359 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,407 software developers and data experts.

using variable to address (function in) other frame..

Hya,

Think it's a simple question:

on a page I have a couple of IFRAME's loaded on top of each other, only one
visible.
With a simple:

parent.document.getElementById("layername").style. visibility

I can easily make swith between the diffrent iframes with 'visible' /
'hidden'..
Now.. After making a iframe visible, I have to trigger a function _inside_
the iframe, to check if the content has to be reloaded / refreshed..
But:

parent.layername.check('123');

returns an error saying layername doesn't exist...
How can I make javascript understand layername is a variable..???...???

Thanx in advance,
Marco Snoek
Jul 20 '05 #1
4 5736
"Marco Snoek" <[mps]@DONT _ YOU^DARE%SEND/SPAM!!!@remove/this[@webmind.nl]@remove/this> writes:
on a page I have a couple of IFRAME's loaded on top of each other, only one
visible.
With a simple:

parent.document.getElementById("layername").style. visibility

I can easily make swith between the diffrent iframes with 'visible' /
'hidden'..
That code is executed inside one of the iframes, right?
Now.. After making a iframe visible, I have to trigger a function
_inside_ the iframe, to check if the content has to be reloaded /
refreshed.. But:

parent.layername.check('123');

returns an error saying layername doesn't exist...
How can I make javascript understand layername is a variable..???...???


Are you sure it *is* a variable? How is the name "layername" attached
to the iframe, with the "id" or "name" attribute (I would use "name")?
Which browser do you use?

If the code is executed in the same iframe as the first line, I would write:

parent.frames['layername'].check('123');

It should work. It does in the example here (using the name attribute
for the iframe):
<URL:file://localhost/D:/Home/lrn/html/faq/JSwindows.html#ref_3_12>

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2
Great!!!!!

That was the trick!!
parent.frames[layername].test('123');
worked all right!!

(Use IE6 btw)

Thanx Lasse!!!!

"Marco Snoek" <[mps]@DONT _
YOU^DARE%SEND/SPAM!!!@remove/this[@webmind.nl]@remove/this> schreef in
bericht news:3f***********************@news.xs4all.nl...
Hya,

Think it's a simple question:

on a page I have a couple of IFRAME's loaded on top of each other, only one visible.
With a simple:

parent.document.getElementById("layername").style. visibility

I can easily make swith between the diffrent iframes with 'visible' /
'hidden'..
Now.. After making a iframe visible, I have to trigger a function _inside_
the iframe, to check if the content has to be reloaded / refreshed..
But:

parent.layername.check('123');

returns an error saying layername doesn't exist...
How can I make javascript understand layername is a variable..???...???

Thanx in advance,
Marco Snoek

Jul 20 '05 #3
"Marco Snoek" <[mps]@DONT _ YOU^DARE%SEND/SPAM!!!@remove/this[@webmind.nl]@remove/this> writes:
parent.frames[layername].test('123');
worked all right!!


Ah, so "layername" *is* a variable, so
parent.document.getElementById("layername").style. visibility

was incorrect in using it as a string!

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #4
Yes, getElementById("layername") was wrong....

well spotted :-))

Marco

"Marco Snoek" <[mps]@DONT _
YOU^DARE%SEND/SPAM!!!@remove/this[@webmind.nl]@remove/this> schreef in
bericht news:3f***********************@news.xs4all.nl...
Great!!!!!

That was the trick!!
parent.frames[layername].test('123');
worked all right!!

(Use IE6 btw)

Thanx Lasse!!!!

"Marco Snoek" <[mps]@DONT _
YOU^DARE%SEND/SPAM!!!@remove/this[@webmind.nl]@remove/this> schreef in
bericht news:3f***********************@news.xs4all.nl...
Hya,

Think it's a simple question:

on a page I have a couple of IFRAME's loaded on top of each other, only

one
visible.
With a simple:

parent.document.getElementById("layername").style. visibility

I can easily make swith between the diffrent iframes with 'visible' /
'hidden'..
Now.. After making a iframe visible, I have to trigger a function _inside_ the iframe, to check if the content has to be reloaded / refreshed..
But:

parent.layername.check('123');

returns an error saying layername doesn't exist...
How can I make javascript understand layername is a variable..???...???

Thanx in advance,
Marco Snoek


Jul 20 '05 #5

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

Similar topics

1
by: Gooseman | last post by:
Hi, I have coded a frame based banner (like the one you get from hotmail when you click on an external link). The problem is that when you drag and drop the ie address bar shortcut icon, it...
7
by: Valiz | last post by:
Hi, I am updating system time with IRIG time source which sends irregular pulses as shown below 11000011111100111111111111111111....(1-IRIG present and 0-IRIG not present) I need to update...
0
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
4
by: Kathryn | last post by:
I hope you can help as this is driving me crazy! I have an asp which has 3 frames on it as follows: <FRAMESET rows="50%,*,10%"> <FRAME src="rundetailstop.asp" name="rundetailstop"...
9
by: CW | last post by:
I wrote an HTML based chat application. The front end is built entirely on HTML + javascript. Essentially, I have a hidden frame that's refreshed frequently and any new messages are displayed in...
20
by: Sushil | last post by:
Hi gurus I was reading FAQ "alloca cannot be written portably, and is difficult to implement on machines without a conventional stack." I understand that the standard does not mandate...
2
by: Chris Stankevitz | last post by:
Hi, I have some weird behavior in a very large (500,000 line) program that I boiled down to a few lines: TCSensorMode::ProcessMeasurement() { InternalComplicatedFunction(1.0, 2.0); int a =...
0
by: bsdixon21222 | last post by:
Hello All, I havn't been programming with python too long, but decided the best way to learn it would be to dive right in. Right now I have been taking snippets here and there along with...
2
by: I Hate My Computer | last post by:
I am using frames on a website. The title link on the title page adds a query string. The link goes to a page with two rows the second has two columns. I want the right column to be changed depending...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.