change top frame location

Discussion in 'Javascript' started by drec, Nov 29, 2006.

  1. drec

    drec Guest

    Is it possible using Javascript to send "Frame1" a new location or URL
    when "Frame2" is loaded?

    I am passing a variable through the URL using 2 php scripts (top and
    bottom.php) when a user clicks a link. In my example, Users can click
    on a letter of Alphabet (in top.php) and it will pass the url
    "bottom.php?order=A". After this I can grab the value and have it
    stored in bottom.php, but I would like to also send this value back to
    top.php without any user intervention.

    I have tried using topframe.location="top.php?order=$variable" but am
    having no luck.
     
    drec, Nov 29, 2006
    #1
    1. Advertising

  2. drec

    ASM Guest

    drec a écrit :
    > Is it possible using Javascript to send "Frame1" a new location or URL
    > when "Frame2" is loaded?


    Usual double link (using at same time html and JS)

    <a href=page_1.htm" target="frame_A"
    onlick="parent.frame_B.location = 'page_2.htm'>menu 1</a>

    > I am passing a variable through the URL using 2 php scripts (top and
    > bottom.php) when a user clicks a link. In my example, Users can click
    > on a letter of Alphabet (in top.php) and it will pass the url
    > "bottom.php?order=A".


    <a href=top.php?order=A" target="topFrame"
    onlick="parent.bottomFrame.location = 'bottom.php?order=A'>A</a>
    <a href=top.php?order=B" target="topFrame"
    onlick="parent.bottomFrame.location = 'bottom.php?order=B'>B</a>


    With a form :

    <form action="top.php" method="get" target="topFrame"
    onsubmit="
    parent.bottomFrame.location = 'bottom.php?order='+this.order.value;
    ">
    <select name="order">
    <option value="A">A
    <option value="B">B
    ..../...
    <option value="Z">Z
    </select><input type=submit value=GO>
    </form>


    --
    Stephane Moriaux et son moins vieux Mac déjà dépassé
    Stephane Moriaux and his less old Mac already out of date
     
    ASM, Nov 29, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Frederic HOUDE
    Replies:
    4
    Views:
    609
    Frederic HOUDE
    Aug 31, 2004
  2. ABC
    Replies:
    0
    Views:
    602
  3. Cuthbert
    Replies:
    8
    Views:
    445
    Ancient_Hacker
    Sep 13, 2006
  4. find clausen

    window.opener.top.location.top.close ???

    find clausen, Oct 5, 2003, in forum: Javascript
    Replies:
    2
    Views:
    444
    find clausen
    Oct 5, 2003
  5. Leoa
    Replies:
    7
    Views:
    219
    -Lost
    Jun 20, 2007
Loading...

Share This Page