targetting in main frame

E

E.J.M. Fakkeldij

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
 
F

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top