Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Jun 2002
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Passing Variables to Form Pages

    Does anybody know of a technique to pass variables to frame pages using javascript?

    I can use window.location.search to retrieve a variable from a normal page.

    I'm going for the effect of when a user clicks on a link, it opens a frame window with my navigation bar on the top and the new page on bottom.

    The problem is that I want to specify which page loads in the bottom in the link to the frame page.

    For example:

    <a href="/framesetpage.html?link=http://mysite.com">View this site</a>
    <a href="/framesetpage.html?link=http://yoursite.com">View your site</a>

    Then it loads a frame page with the nav page at the top, and whatever page was clicked on below...

  • #2
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72 W. 48' 57" , 41 N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    yeah, i think i know what you want.

    you use links the way you've got them set up now, and your frameset page looks like this.

    <script>
    function lode() {
    var temp = "";
    if (window.location.search) {
    temp = window.location.search.slice(1);
    }

    self.frames['bottomFrame'].location = temp;
    }

    self.onload = lode;
    </script>
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #3
    New Coder
    Join Date
    Jun 2002
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What am I doing wrong on this?

    I'm calling the page "outside.html" and referencing it using <a href="outside.html?temp=http://www.mysite.com">Link is here</a>


    The source of "outside.html" looks like:

    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html>
    <head>
    <frameset ROWS="108,*" >
    <frame NAME="A" SRC="framenav.html" NORESIZE="yes" SCROLLING="no">
    <frame NAME="B" SRC="framemain.html">
    </frameset>
    </head>
    <body>

    <script>
    function lode() {
    var temp = "";
    if (window.location.search) {
    temp = window.location.search.slice(1);
    }

    self.frames['B'].location = temp;
    }

    self.onload = lode;
    </script>

    </body>
    </html>

  • #4
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72 W. 48' 57" , 41 N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    <a href="outside.html?temp=http://www.mysite.com">Link is here</a>

    get rid of the part in bold, and it should work.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #5
    New Coder
    Join Date
    Jun 2002
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hmmm...

    No errors show up but it never redirects to the new page. Just shows framemain.html in the lower frame.

  • #6
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72 W. 48' 57" , 41 N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    can i see a link to the page this is on?
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hmm...

    I think Dave Clark has a script that does something like this... I remember seeing it in the old forum...
    redhead

  • #8
    New Coder
    Join Date
    Jun 2002
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay...

    after copying the code directly it came up with an error:
    'window.top.frames.pageb has no properties.'

    I changed this line:
    <frame name="cartfmainwindow" scrolling="yes">

    to this:
    <frame name="cartfmainwindow" scrolling="yes" src="framemain.html">

    and it worked! No clue why but I'm glad it does!

    Thanks for the help,

    - J


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •