• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
JavaScriptSource

JavaScriptSource

Search 5,000+ Free JavaScript Snippets

  • Home
  • Browse Snippets
    • Addon
    • Ajax
    • Buttons
    • Cookies
    • CSS
    • Featured
    • Forms
    • Games
    • Generators
    • Image Effects
    • Math Related
    • Miscellaneous
    • Multimedia
    • Navigation
    • Page Details
    • Passwords
    • Text Effects
    • Time & Date
    • User Details
Home / Page Details / Reload on Resize

Reload on Resize

Reload on Resize

Useful for situations when a page resize moves the page elements improperly or causes JavaScript errors, which has been known to occasionally occur on pages with layers. As a solution, this script reloads the web page when the user resizes the page.


If you resize this page, it is reloaded. Try it!

<!– ONE STEP TO INSTALL RELOAD ON RESIZE:

  1.  Add the onLoad event handler into the BODY tag  –>

<!– STEP ONE: Insert the onLoad event handler into your BODY tag  –>

<BODY onResize=”window.location.href = window.location.href;”>

<p></p><center>
<font face="arial, helvetica" size="-2">Free JavaScripts provided<br />
by The JavaScript Source
</font></center><p>

Page Details

Related Snippets:

  • Get the size of an image
  • Redirection: How to Change the URL in JavaScript
  • Check if the browser tab of the page is focused
  • Find the distance from a given element to the top of the document

Primary Sidebar

Popular Posts

Story Generator

IP Grabber – get a users IP address with JavaScript

Simple Calendar

Remove Ads

Astrological Calculator

Copyright © 2025 JavaScriptSource.com

  • About
  • Privacy Policy
  • FAQ
  • Jobs For Developers