/    Sign up×
Community /Pin to ProfileBookmark

Pass parameters to forward framing src using JS

Hi,

Is it possible to pick up parameters from the page url and add it to the forward framing SRC?

So the result from the below [url]www.new_website.com/page.html?ReferringagentID=1010&AnotherID=555[/url]

Forward framing code:

<HTML>
<FRAMESET ROWS=”*,0″ FRAMEBORDER=0 BORDER=0 FRAMESPACING=0 >
<FRAME SRC=”http://www.website.com” />
</FRAMESET>
</HTML>

I know of a similar code in cold fusion but I would like a JavaScript version of that.

Similar function in Cold fusion:

<cfif isDefined(“url.ReferringAgentID”)><cfset ReferringAgentId=url.ReferringAgentId><cfelse><cfset ReferringAgentId=””></cfif>

Then at the end of the link to open a page add:

?ReferringAgentId=<cfoutput>#ReferringAgentId#</cfoutput>

Any help in this would be much appreciated

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@jacjil2Jul 30.2009 — document.getElementsByTagName('frame')[0].src = "http://www.website.com"+parameters;

EDIT:

from within the frame:

document.parent.getElementsByTagName('frame')[0].src = "http://www.website.com"+parameters;
Copy linkTweet thisAlerts:
@suzanne123authorAug 04.2009 — Sorry if am being slow! could you please expalin further where about in the code i need to place these?


also parameters, could these be like id=1010&pp=6565, i.e. adding (&)
Copy linkTweet thisAlerts:
@suzanne123authorAug 04.2009 — for the second part of the code; is this what you meant?

<FRAME document.parent.getElementsByTagName('frame')[0].src ="https://www.website.com/"+rp=1010&ID=55&nO=6565 />
×

Success!

Help @suzanne123 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.2,
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,
)...