Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accessing JS in a Frame within an IFrame

Status
Not open for further replies.

ggriffit

Programmer
Oct 25, 2002
1,578
GB
Dear All,
I am surfacing one web based app my firm uses inside an IFrame of another, however I need to call some of the JS functions of the app that I am surfacing and these are within a frameset, I've tried the usual document.<iframename>.frames["<framename>"] and am not really getting there, any ideas ?

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Hi

Is possible, but I have no idea what exactly to suggest to you. I did not understood the [tt]frame[/tt]/[tt]iframe[/tt] structure you have. Give us more details, an ASCII art sketch with comments would be perfect.

Feherke.
 
What I have is an page (/myDir1/test.html) which contains an iframe into which I load a file (/myDir2/frameset.html) which contains a frameset with two frames (navbar.html and content.html) in it, one of the frames contains a futher frameset.

What I need to do is from the top page (test.html) call a JS function in one of the Framed pages (navbar.html).

Greg Griffiths
Livelink Certified Developer & ECM Global Star Champion 2005 & 2006
 
Hi

Works for me with this files in Mozillas, Opera, Safari and Explorer. If I understand you correctly...
Code:
<html>
<head>
<script>
function doHmm()
{
  [red]fr[/red].[green]nav[/green].[blue]fur[/blue].hmm('hello')
}
setTimeout('doHmm()',1000)
</script>
</head>
<body>
<iframe name="[red]fr[/red]" src="frameset.html">
</body>
</html>
Code:
<html>
<frameset>
<frame name="[green]nav[/green]" src="navbar.html">
<frame src="content.html">
</frameset>
</html>
Code:
<html>
<frameset>
<frame name="[blue]fur[/blue]" src="further.html">
</frameset>
</html>
Code:
<html>
<head>
<script>
function hmm(what)
{
  alert('top said "'+what+'"')
}
</script>
</head>
<body>
</body>
</html>

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top