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

    Loading results into an iframe

    I'm trying desperately to get this project done and I could use some help. I am using an external mapping tool on a site that I am doing. The site visitor would input their address or zip code and select distance. They would be presented with a store location near them. When they click on that link, it would take them to that store's specific page. In each store's specific page, I have the following javascript in the header:

    Code:
    var tS=window.location.search.split("&");
    var tSearch=tS[0].split("=")[1];
    var tSource=tS[1].split("=")[1];
     
    function loadMap()
    {
    window.location="http://externalsite.com/ctc2.jsp?rds=yes&search="+tSearch+"&source="+tSource;
    }
    I then have a link on that page for map & directions which uses the following code:

    Code:
    javascript:loadMap();
    This is working well as far as functionality goes, but the link actually goes to the external site and I need it to load in an iframe or similar, so it looks like the rest of the site.

    Any help would be greatly appreciated.
    Last edited by ctcdesigns; 09-24-2008 at 10:38 PM. Reason: Title change

  • #2
    Regular Coder
    Join Date
    Mar 2008
    Posts
    301
    Thanks
    2
    Thanked 30 Times in 30 Posts
    Try onclick="loadMap();", and if you want to load an iframe, you'll reset the .src property of the iframe instead of trying to reload the window and lose your script.

  • #3
    New to the CF scene
    Join Date
    Sep 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks for the tip fside. I guess that is where I am lost. How to I load the results into an iFrame?

  • #4
    Regular Coder
    Join Date
    Mar 2008
    Posts
    301
    Thanks
    2
    Thanked 30 Times in 30 Posts
    The "src" property, already mentioned.

    If you use a generic - object - I believe that can load a webpage using the "data" property. But I think the iframe will be more accessible.


  •  

    Posting Permissions

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