0

I tried using this but did not work:

$(document).ready(function(){
  $("#restartBtn").click(function(){
    location.reload();
  });
});

This is my code:

<canvas id="canvas" width="1125" height="2436" class="" style="width: 375px; height: 812px;"></canvas>

<img id="restartBtn" src="./images/btn_restart.svg" style="display: inline;">

Can we add link on that restart button?

H77
  • 5,859
  • 2
  • 26
  • 39
  • 1
    Your code should work fine. What doesn't work? – H77 Apr 02 '18 at 02:38
  • 2
    Maybe a cache problem? – NewToJS Apr 02 '18 at 02:40
  • try typing in browser console: `location.reload()`, if it can refresh the page, then it should be working, and probably just a cache problem – am05mhz Apr 02 '18 at 02:46
  • 1
    Have you tried using `location.reload(true);`? This question might be helpful and it has the suggestion given has been accpeted as a working solution/answer [**window.location.reload with clear cache**](https://stackoverflow.com/questions/5721704/window-location-reload-with-clear-cache#answer-5722855) – NewToJS Apr 02 '18 at 02:52

0 Answers0