script bug...

by 3 replies
6
Hello, what do you need to do to this script below to stop it from redirecting to the index page? I know it has something to do with: window.location.href = "index.html?status=1";
at the bottom but I'm not sure how you do this. Do you just remove it or something? How should the code look when it's setup not to redirect users to the index.html page?

---------------------------------------------------------------
<script language="javascript">

function getURLParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [null, ''])[1].replace(/\+/g, '%50')) || null;
}
document.cookie = "POSTAff2Cookie="+getURLParameter('a_aid')+"_1 ";

OrderID=Math.floor(Math.random() * 100) + 1 ;
ProductID=Math.floor(Math.random() * 100) + 1 ;
TotalCost=Math.floor(Math.random() * 100) + 1 ;
data = "TotalCost="+TotalCost+"&ProductID="+ProductID+"&O rderID="+OrderID;
console.log(data);
document.write("<img src='http://xxxxxxxx/xxxxx-scripts/xxxxx.php?"+data+"' border='0' width='1' height='1'>");
setTimeout(function() {
window.location.href = "index.html?status=1";
}, 4000);

//-->
</script>
#programming #bug #script
  • setTimeout(function() {
    window.location.href = "index.html?status=1";
    }, 4000);

    This setTimoOut function redirects to index.html, you can remove it if you don't want it to redirect
  • so just remove:

    setTimeout(function() {
    window.location.href = "index.html?status=1";
    }, 4000);

    ...

    ???

    Thanks.
    • [1] reply
    • Yes, remove the code

      setTimeout(function() {
      window.location.href = "index.html?status=1";
      }, 4000);

      and it should stop to redirect

Next Topics on Trending Feed

  • 6

    Hello, what do you need to do to this script below to stop it from redirecting to the index page? I know it has something to do with: window.location.href = "index.html?status=1"; at the bottom but I'm not sure how you do this. Do you just remove it or something? How should the code look when it's setup not to redirect users to the index.html page?