Hello All,
I know next to nothing about coding so I was hoping to get some help. I guess what I’m trying to do is use JavaScript to handle the GET variable.
I have a real estate website I’m working on and need to integrate a third party IDX solution. I have a portion of the site where visitors can search for specific properties but when they click on the button it opens up into iframe in another window displaying only the property information without my page template/design behind it. I was told there is a way to do this by using javascript and GET request URL to create an iframe of the linked content. I just need some help finishing/correcting this script. Thanks in advance!
Here is what I have so far:
Page.html:
<script src=”
<script type=’text/javascript’>idexcompany.createQuickSearchWidget(‘login-id’,’listing-results.html?url=’,{“Name”:””,”RegionId”:27,”BackgroundColor”:”#004080″,”ForeColor”:”#FFFFFF”,”Horizontal”:false,”Cities”:[],”CitiesWithAreas”:[],”PropTypes”:{“Single Family”:1,”Condo/Townhouse”:2,”Multi-Family”:8,”Land”:32}});</script>
listing-results.html (iframe page):
(I took this code from [url]http://javascript.about.com/library/blqs1.htm
qsParm[‘url’] = null;
qs();
var qsParm = new Array();
function qs() {
var query = window.location.search.substring(1);
var parms = query.split(‘&’);
for (var i=0; i<parms.length; i++) {
var pos = parms[i].indexOf(‘=’);
if (pos > 0) {
var key = parms[i].substring(0,pos);
var val = parms[i].substring(pos+1);
qsParm[key] = val;
}
}
}
</script>
if(qsParm[‘url’]){ document.write(“<iframe src=’” + qsParm[‘url’] + “’></iframe>); }