Forum Moderators: open
I have a very simple request, but I have no direct experience of coding javascript. I have been provided with a completed piece of javascript for my page but now I want to take a couple of the variables and write them to different parts of my page using the code supplied. See below. I want to take the order ID (OID) and the transaction value (SV) and write them to different parts of my page within some html. So my question is, how do I do that?
Thanks.
Steve
<script language="javascript">
var arrParams = location.search.split("?")[1].split("&");
var SV = '';
var OID = '';
var temp = '';
if(location.search.indexOf("?")!=-1)
{
if (arrParams)
{
for (i=0;i<arrParams.length;i++)
{
var param=arrParams[i].split("=");
temp = param[0];
if(temp.toLowerCase()=="amt")
{
SV = param[1]
}
if(temp.toLowerCase()=="tx")
{
OID = param[1]
}
}
}
}
document.write ('<img src="https://www.**********.com/AdvTransaction.aspx?AdID=****&SV=' + SV + '&OID=' + OID + '" height="0" width="0" border="0">');
</script>