Compdigitec Labs

« | Home | »

Fixing “Error: window.location.refresh is not a function”

By admin | July 23, 2010

If when you try to refresh the page using Javascript back-end and instead of having the page refresh like you want it to refresh, instead it bounces back into your Javascript Console with a cryptic error that reads “Error: window.location.refresh is not a function“. This can be very puzzling, especially if you are not a regular JavaScript programmer, so one can look into the documentation:

object.reload( [bReloadSource])

Reloads the current page

There’s just one small problem – it’s actually object.reload, not object.refresh! Some poor quality websites (or popular websites which make mistakes) accidently specify location.refresh instead of location.reload. So instead of calling location.refresh(), one should call the following to refresh the page:

window.location.reload();

If you found this article helpful or interesting, please help Compdigitec spread the word. Don’t forget to subscribe to Compdigitec Labs for more useful and interesting articles!

Topics: (X)HTML | 8 Comments »

8 Responses to “Fixing “Error: window.location.refresh is not a function””

  1. กระเช้า Says:
    August 4th, 2025 at 21:12

    … [Trackback]

    […] Here you will find 19345 more Information to that Topic: compdigitec.com/labs/2010/07/23/fixing-error-window-location-refresh-is-not-a-function/ […]

  2. siamlotto 168 Says:
    September 13th, 2025 at 19:17

    … [Trackback]

    […] Here you will find 24261 more Info on that Topic: compdigitec.com/labs/2010/07/23/fixing-error-window-location-refresh-is-not-a-function/ […]

  3. ซื้อเหล้าออนไลน์ Says:
    September 16th, 2025 at 20:10

    … [Trackback]

    […] Find More on on that Topic: compdigitec.com/labs/2010/07/23/fixing-error-window-location-refresh-is-not-a-function/ […]

  4. 3xbet Says:
    September 20th, 2025 at 18:22

    … [Trackback]

    […] Find More Info here on that Topic: compdigitec.com/labs/2010/07/23/fixing-error-window-location-refresh-is-not-a-function/ […]

  5. ร้านเค้กวันเกิดใกล้ฉัน Says:
    September 26th, 2025 at 06:58

    … [Trackback]

    […] Find More on to that Topic: compdigitec.com/labs/2010/07/23/fixing-error-window-location-refresh-is-not-a-function/ […]

  6. รับสร้างบ้านเชียงใหม่ Says:
    October 4th, 2025 at 11:54

    … [Trackback]

    […] There you can find 74624 additional Information on that Topic: compdigitec.com/labs/2010/07/23/fixing-error-window-location-refresh-is-not-a-function/ […]

  7. vg98 Says:
    October 8th, 2025 at 21:09

    … [Trackback]

    […] Here you will find 59978 additional Info on that Topic: compdigitec.com/labs/2010/07/23/fixing-error-window-location-refresh-is-not-a-function/ […]

  8. адмирал х отзывы Says:
    October 9th, 2025 at 23:14

    … [Trackback]

    […] Find More on to that Topic: compdigitec.com/labs/2010/07/23/fixing-error-window-location-refresh-is-not-a-function/ […]

Comments