Hello,
I have the script below to extract the parameters in the parent window URL but I need to paste them onto the URL that will be called from an i-frame. Can somebody tell me the syntax to build the new URL for this i-frame?
this is the code to extract the parameters
I have the script below to extract the parameters in the parent window URL but I need to paste them onto the URL that will be called from an i-frame. Can somebody tell me the syntax to build the new URL for this i-frame?
this is the code to extract the parameters
Code:
function addCampParam ( endUrl )
{
var mc_id_param = gup( 'WT.mc_id' );
var acctnum_param = gup( 'acctnum' );
var cmpltUrl = endUrl + "&WT.mc_id=" + mc_id_param + "&acctnum=" + acctnum_param + "&WT.mc_ev=ContentClick";
window.location = cmpltUrl;
}
function gup( name )
{
var regexS = "[\\?&]"+name+"=([^&#]*)";
var regex = new RegExp( regexS );
var tmpURL = window.location.href;
var results = regex.exec( tmpURL );
if( results == null )
return "";
else
return results[1];
}