Reload the current page

Load the current document again.

JavaScriptBrowser · DOM Version 1.0.0 · MIT · .md

reload-the-current-page.js
function reload() { location.reload(); }

Usage

usage.js
reload(); // e.g. the page loads again; browsers may restore form fields and scroll position

Reviewed, not executed: calling it navigates away from the page.

Know the limits

  • Reloading discards in-memory state. Prefer updating the part of the page that changed.
  • The original’s alternative, location.href = location.href, does not reload when the URL has a fragment: it only scrolls.

The function above is the code the usage lines run. It does not validate its arguments; add checks where it receives untrusted input.

Source & maintenance

Based on Reload the current page from the original 1loc collection by Nguyen Huu Phuoc. Copyright (c) 2020 phuoc-ng. MIT licensed.

Reviewed, not executed, because it navigates. Original MDX retained as inert source evidence.

Maintained by Oveyon. Source commit: 14b481cf60df. Read the license.

Reviewed, not executed: calling it navigates away from the page · reviewed October 28, 2026.

Keep exploring

Type two or more characters. Try “duplicate”, “webhook” or “retry”.