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

    Have URL reflect what is loaded in iframe?

    *delete other post please, didn't make any sense*

    Okay, I've seen some examples of being able to click on a link, and have another page load that has an iframe with a specific page inside it.

    I've tried it on my site, and it shows on the URL "**.com\foo.html?bar.html"

    I want to be able to do this, without having to go to another page. I want to be able to link to an iframe on my homepage, and after someone clicks on the link, it shows it in the url.

    For the purpose of users being able to make a certain page with info loaded in iframe as a homepage or a bookmark.

    Thanks!

    Trevor

  • #2
    New to the CF scene
    Join Date
    Oct 2005
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Heres what I'm using now that I found on another page:

    I have the javascript:

    <script>
    function getSource()
    {
    ifsrc=location.search.substring(1)
    ifsrc=ifsrc.substring(6,ifsrc.length)
    document.getElementById('iframe').src = ifsrc
    }
    </script>

    And for the link I put "index.html?ifsrc=arts.html" and took off the target part of the link.

    Functionally, it works. My URL is: "http://**/index.html?ifsrc=arts.html"

    HOWEVER, it still has to reload the entire page to do it. I was hoping that I didn't have to reload the entire page.

    Possible?

  • #3
    Senior Coder
    Join Date
    Dec 2004
    Location
    Essex, UK
    Posts
    2,636
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You won't be able to do it without reloading the whole page.


  •  

    Posting Permissions

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