/    Sign up×
Community /Pin to ProfileBookmark

Passing Variables to iframe

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=”http://idxcompany.com/services/idx123fh.js” type=”text/javascript”></script>

<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[/url])

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>); }

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @digitalplat4m spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.6,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...