By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,729 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,729 IT Pros & Developers. It's quick & easy.

targetting in main frame

P: n/a
Hello,

I'm rather new in javascript programming.
I have a frame:
<frameset framespacing="0" border="0" rows="47,*" frameborder="0">
<frame name="banner" scrolling="no" noresize target="contents"
src="../Banner.htm">
<frameset cols="225,*">
<frame name="contents" target="main" src="homeLeft.html"
scrolling="auto">
<frame name="main" src="../Inhoud.htm">
</frameset>

en I like to target from contents to main:
<SPAN
ONCLICK="parent.location.href='http://www.ic2.com/scripts/vert.exe?lang=NL&page=/iconnect/default.htm'">

but the page opens in contents.

Also
<SPAN
ONCLICK="parent.main.location.href='http://www.ic2.com/scripts/vert.exe?lang=NL&page=/iconnect/default.htm'">
won't work

Do I have to declare parent.main.location.href somewhere?

Elke
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Fox
Wel, Elke, ik denk dat uw probleem het volgende is:

parent.main.location.href='http://www.ic2.com/scripts/vert.exe?lang=NL&page=
/iconnect/default.htm'

"parent" points to a "window" object, NOT a "frame" object. I would do it as
follows:

<span onclick="OnClick(this);">...</span>

in a javascript file (handlers.js):

function OnClick(e)
{
var mainframe = window.parent.document.getElementById("main");
mainframe.src = "http://www.amabuy.com";
}

See? I just tested it, Works fine.

http://www.amabuy.com


Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.