1

I am trying to reload page. But getting prompt message.

location.reload();

$window.location.reload();

Is there a way to reload page without prompting a message?

Nagarjuna Reddy
  • 4,083
  • 14
  • 41
  • 85

3 Answers3

3

try using window.onbeforeunload = null; before window.location.reload().

2

You can use window.location = window.location.href;

Jinal Mehta
  • 171
  • 6
0

In Jquery simply use -

  $(selector).click(function(e) {
    e.preventDefault();
    $(window).off('beforeunload');
    window.location.reload()
  });
Shekhar Patil
  • 337
  • 4
  • 14