View Full Version : Loading results into an iframe

09-24-2008, 10:04 PM
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:

var tS=window.location.search.split("&");
var tSearch=tS[0].split("=")[1];
var tSource=tS[1].split("=")[1];

function loadMap()

I then have a link on that page for map & directions which uses the following code:


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.

09-24-2008, 10:07 PM
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.

09-24-2008, 10:10 PM
Thanks for the tip fside. I guess that is where I am lost. How to I load the results into an iFrame?

09-25-2008, 12:07 PM
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.