Web Analytics Made Easy -
StatCounter Load into a Iframe then onLoad into a Iframe? - CodingForum

Announcement

Collapse
No announcement yet.

Load into a Iframe then onLoad into a Iframe?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Load into a Iframe then onLoad into a Iframe?

    hello need a hand loading a page into a differant iframe using onLoad:

    I have two Iframes on a page and some links, the first iframe is called 'Main' the other called 'arrow', what i am trying to do is when i click a link which loads up content in the main iframe once that page is loaded it loads up content into the other iframe i.e.'arrow'

    ive been tying it with this:

    <script language="JavaScript">
    <!--
    function MM_goToURL() { //v3.0
    var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
    for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
    }
    //-->
    </script>

    onLoad="MM_goToURL('parent','file: blank.htm');return document.MM_returnValue">

    OR - could is it possiable to load two seperate pages into two seperate iFrames using one link ?!?

    but of coase this just loads it into the current iframe.
    Yes its macromedia, (god help me).
    Last edited by SpamyDan; Jul 3, 2002, 11:50 AM.

  • #2
    Managed to work out how two do two frames at once - incase anybody needs to know:

    <script>
    function Click(){
    document.Main.location.href = "http://www.codingforum.net"
    document.Arrow.location.href = "http://www.yahoo.com"
    }
    </script>

    <a href="javascript:Click()">Click Here</a>

    Just need to work out onLoad now!

    Comment


    • #3
      heres what you can do.

      In the actual link on the page, put this

      <script language="javascript">

      function link(){

      parent.Main.location.href="whatver.html"

      }
      </script>


      -------

      Now in the page - whatver.html - put an onload function like this

      <script language="javascript">

      function link2(){

      parent.arrow.location.href="whatver2.html"

      }
      </script>

      <body onload="link2()">

      -------

      This should work hehe (Never does though)
      CYWebmaster.com - See why we dot com!!
      ACJavascripts.com - Cut & Paste Javascripts!
      SimplyProgram.com - Personal Blog

      Comment

      Working...
      X