Forum Moderators: open
So the rout is: email links > to one iframe to > multiple varriable web sites based on the varriables on the orriginal email links.
I am not a programmer so any help much appreciated.
I assume the orriginal links will need varriables appended to them
i.e.
[mywebsite.com?link1...]
[mywebsite.com?link2...]
[mywebsite.com?link3...]
these varriables will then be picked up by some javascript in the iframe and redirect accordinly to what ever the varriables are assigned to.
Many thanks in advance.
<script type="text/javascript">
function getURLParam(strParamName){
var strReturn = "";
var strHref = window.location.href;
if ( strHref.indexOf("?") > -1 ){
var strQueryString = strHref.substr(strHref.indexOf("?"));
var aQueryString = strQueryString.split("&");
for ( var iParam = 0; iParam < aQueryString.length; iParam++ ){
if (aQueryString[iParam].indexOf(strParamName + "=") > -1 ){
var aParam = aQueryString[iParam].split("=");
strReturn = aParam[1];
break;
}
}
}
return strReturn;
}switch(getURLParam('link')*1)
{
case 1:
document.write('<iframe src="http://www.site1.com"></iframe>');
break;
case 2:
document.write('<iframe src="http://www.site2.com"></iframe>');
break;
default:
document.write('<iframe src="http://www.site3.com"></iframe>');
}
</script>
And your links need to look like this;
http://www.example.com?link=1
http://www.example.com?link=2
http://www.example.com?link=3
I haven't actually tried it but it should work.