targetting in main frame

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • E.J.M. Fakkeldij

    targetting in main frame

    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="content s"
    src="../Banner.htm">
    <frameset cols="225,*">
    <frame name="contents" target="main" src="homeLeft.h tml"
    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=N L&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=N L&page=/iconnect/default.htm'">
    won't work

    Do I have to declare parent.main.loc ation.href somewhere?

    Elke


  • Fox

    #2
    Re: targetting in main frame

    Wel, Elke, ik denk dat uw probleem het volgende is:

    parent.main.loc ation.href='htt p://www.ic2.com/scripts/vert.exe?lang=N L&page=
    /iconnect/default.htm'

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

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

    in a javascript file (handlers.js):

    function OnClick(e)
    {
    var mainframe = window.parent.d ocument.getElem entById("main") ;
    mainframe.src = "http://www.amabuy.com" ;
    }

    See? I just tested it, Works fine.

    Get a new domain name for your startup. Quick and professional service. Seamless domain transfers.





    Comment

    Working...