Results 1 to 8 of 8

Thread: open external page link in other page's iFrame

  1. #1
    Join Date
    Oct 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question open external page link in other page's iFrame

    I have a indexframe.htm in which I have an Iframe called "MainFrame". The scr="main.htm" , so this is the first page opened inside the iframe.

    now I want from an external page to open forum.htm inside the Iframe in indexframe.htm ("MainFrame").

    how do I do this?

  2. #2
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    <a href="forum.htm" target="MainFrame">Forum</a>

    Should work.

    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

  3. #3
    Join Date
    Oct 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    lol that would be too easy... you don't understand what I mean!

    Imagine I want forum.htm to open in the iframe of index.htm from a link posted in this forum!

    get my point? an outside link!

  4. #4
    Join Date
    Aug 2004
    Location
    Brighton
    Posts
    1,563
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ooh. Complicated.
    Sorry I can't help any further.

    Merry Christmas
    cr3ative
    A retired member, drop me a line through my site if you'd like to find me!
    cr3ative media | read the stickies

  5. #5
    Join Date
    Oct 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanx. Merry Xmas to you too...
    do you know someone who can help me out?

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Quote Originally Posted by Gabber
    lol that would be too easy... you don't understand what I mean!

    Imagine I want forum.htm to open in the iframe of index.htm from a link posted in this forum!

    get my point? an outside link!
    Well, it would only work if the link appears in the page containing the iframe as well. Otherwise, no, you can't have a link on another page load its page into an iframe. For the former, you can basically get to an iframe using the javascript code:

    document.getElementById("MainFrame").src="newpage.htm"

  7. #7
    Join Date
    Oct 2004
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    sorry for the n00bity, but I don't get it... let's say I have a forum.htm link in the page that has the iframe.
    and I want from an external page (or javascript code within the page) to make to user go the the iframe page and open forum.htm in the iframe...

    get my point?
    now where do I place the line of code you have gave me?

    greetz

    ps: thank you for the time

  8. #8
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Your link will then look something like:

    <a href="javascript:document.getElementById('MainFrame').src='newpage.htm'">Click here</a>

    Again, this assumes the link is in the same page as where the Iframe is.

Bookmarks

Posting Permissions

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