3 replies
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>
#bug #script
Avatar of Unregistered
  • Profile picture of the author divyakochar
    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
    Signature
    {{ DiscussionBoard.errors[11357422].message }}
  • Profile picture of the author Nina Petrov
    so just remove:

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

    ...

    ???

    Thanks.
    {{ DiscussionBoard.errors[11357477].message }}
    • Profile picture of the author dspa72
      Originally Posted by Nina Petrov View Post

      so just remove:

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

      ...

      ???

      Thanks.
      Yes, remove the code

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

      and it should stop to redirect
      {{ DiscussionBoard.errors[11361101].message }}
Avatar of Unregistered

Trending Topics