Search This Blog

Javascript to force a page refresh

  • Method 1:
    • window.location = window.location;
      
  • Method 2: 
    • window.location.href = "index.html" + "?" + Date.parse(new Date());
      
    • or, if the url contains already query
    • window.location.href = "index.php?id=1" + "&" + Date.parse(new Date());
      

No comments:

Post a Comment