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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Aug 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Linking to a page with an iframe, targeting specific page to load inside

    One more question....I'll try to ask this question clearly.

    I have an index.html page that has several links on the bottom, such as about.html, bio.html, etc... When clicked I want the mainpage to pop up, that contains an iframe. BUT I want to target a specific page to load into the iframe when the link is clicked. Example: index.html page - click on link, about.html -the mainpage should then pop up and about.html load into the iframe. Is this possible all in one click??

    Thanks again,
    distortureddoll

  • #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 it is, but it's a little complicated to explain, and i'm real tired right now. if you can wait till tomorrow morning, i can give you an example of how it could be done.
    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 to the CF scene
    Join Date
    Aug 2002
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yes of course I can wait one more day. =) Would appreciate it.

  • #4
    New Coder
    Join Date
    Aug 2002
    Location
    Pakistan
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I wanted the same thing..
    hav u people reached to any final result...?

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,033
    Thanks
    0
    Thanked 249 Times in 245 Posts
    is this what you want?

    function doOpen(url,url2){
    w = window.open(url,"","windowfeatureshere")
    w.onload=new function(){
    window.iframeNameHere.location.href=url2
    }
    }


    then in your links:

    <a href="javascript:doOpen('index.html','about.html')">Link1</a>

    that's javascript without space

  • #6
    New Coder
    Join Date
    Aug 2002
    Location
    Pakistan
    Posts
    56
    Thanks
    0
    Thanked 0 Times in 0 Posts
    dear glenngv,

    I need to reexplain the situation:

    I have 2 pages:
    1) index.html (first page)
    2) main.html (second page) which contains an iframe.

    and now i have few links on index.html which shd open in iframe of main.html.

    Now:

    1) where shd i place the above script.. i mean shd i place it in a .js file and link both pages(index and main) with it.
    2) in main.html, where the iframe is, what source should i give <iframe src='?'>.

    thanks,,
    aakif.

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,033
    Thanks
    0
    Thanked 249 Times in 245 Posts
    index.html and main.html should be open at the same time to work.

    the script above is not applicable to you, this is:

    1. links in index.html:

    <a href="link1.html" target="iframeNameHere">Link1</a>
    <a href="link2.html" target="iframeNameHere">Link2</a>

    change iframeNameHere to your iframe name. if the window, where main.html is loaded, is not open then the links will be opened in a new window.

    2. in your iframe, you should have a default or dummy page loaded. it could either be one of the pages of the links in index.html.


  •  

    Posting Permissions

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