Results 1 to 3 of 3

Thread: Frames

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Posts
    207
    Ok I have a question and need a little help.

    I have this page that has 3 frames on it. What I need to do is have a way so I can put an address after the page and have it change on of the frames to a different address. Ex. http://www.mysite.com/mypage.(cgb,asp,php, something)(?, or some seperator)www.hotmail.com

    I guess the frame name that i want to change would be main and i want it so the above sytax would load the hotmail or someother page in the frame called main.

    Jeremy

  2. #2
    Hyperactive Member Kagey's Avatar
    Join Date
    Sep 2000
    Location
    The Wilderness of New Brunswick
    Posts
    294
    If you want to change the address of a frame, in a link tag you specify the target:
    Code:
    <a href="www.hotmail.com" target="FRAMENAME">Click Here!</a>
    I dont know if that is what you wanted, but it might get you started.

    and the stuff after the "?" in the address is called a querystring, and you can use javascript if you want to capture the value and transfer the appropriate frame to the value. Of course, im a server side guy and i dont know how. you could probably search this forum for javascript and querystrings and find out how though.

    have fun.

  3. #3
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    I think this is what you want.

    use it like this:
    http://sl00257/scratch/frames.htm?m=http://www.vb-world.net

    this will load http://www.vb-world.net into the main frame

    Code:
    <script language=Javascript>
    var m = window.location;
    m = '' + m;
    var i = m.indexOf('?m='); 
    var mainUrl = m.substring(i+3);
    
    document.write('<FRAMESET ROWS="100,*" FRAMEBORDER="no" FRAMESPACING="0" FRAMEBORDER="0" BORDER="0">');
    document.write('<FRAME NAME="top" SRC="top.html" MARGINHEIGHT="10" MARGINWIDTH="10" SCROLLING=no> ');
    document.write('<FRAMESET Cols="100,*" FRAMEBORDER="no" FRAMESPACING="0" FRAMEBORDER="0" BORDER="0"> ');
    document.write('<FRAME NAME="left" SRC="left.html" MARGINHEIGHT="10" MARGINWIDTH="10" SCROLLING=YES> ');
    document.write('<FRAME NAME="main" SRC="' + mainUrl + '" MARGINHEIGHT="10" MARGINWIDTH="10" SCROLLING=YES>');
    document.write('</FRAMESET></FRAMESET>');
    </script>
    Mark
    -------------------

Posting Permissions

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



Click Here to Expand Forum to Full Width