• support@answerspoint.com

How can I refresh a page with jQuery?

332

How can I refresh a page with jQuery?

2Answer


0

Use location.reload():

$('#something').click(function() {
    location.reload();
});

The reload() function takes an optional parameter that can be set to true to force a reload from the server rather than the cache. The parameter defaults to false, so by default the page may reload from the browser's cache.

  • answered 2 years ago
  • Sandy Hook

0

There are unlimited ways to refresh a page with JavaScript:

  1. location.reload()
  2. history.go(0)
  3. location.href = location.href
  4. location.href = location.pathname
  5. location.replace(location.pathname)
  6. location.reload(false)

  • answered 2 years ago
  • Gul Hafiz

Your Answer

    Facebook Share