{"id":181,"date":"2010-07-23T18:06:33","date_gmt":"2010-07-23T23:06:33","guid":{"rendered":"http:\/\/www.compdigitec.com\/labs\/?p=181"},"modified":"2010-07-23T18:09:14","modified_gmt":"2010-07-23T23:09:14","slug":"fixing-error-window-location-refresh-is-not-a-function","status":"publish","type":"post","link":"http:\/\/www.compdigitec.com\/labs\/2010\/07\/23\/fixing-error-window-location-refresh-is-not-a-function\/","title":{"rendered":"Fixing &#8220;Error: window.location.refresh is not a function&#8221;"},"content":{"rendered":"<p>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 &#8220;<strong>Error: window.location.refresh is not a function<\/strong>&#8220;. This can be very puzzling, especially if you are not a regular JavaScript programmer, so one can <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/ms536691(VS.85).aspx\">look into the documentation<\/a>:<\/p>\n<blockquote><p>object.reload( [bReloadSource])<\/p>\n<p>Reloads the current page<\/p><\/blockquote>\n<p>There&#8217;s just one small problem &#8211; it&#8217;s actually object.<strong>reload<\/strong>, <em><strong>not<\/strong><\/em> object.<strong>refresh!<\/strong> 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:<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">window.location.reload();<\/pre>","protected":false},"excerpt":{"rendered":"<p>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 &#8220;Error: window.location.refresh is not a function&#8220;. This can be very puzzling, especially if you are not a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[522,701,702],"_links":{"self":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/181"}],"collection":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/comments?post=181"}],"version-history":[{"count":0,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/posts\/181\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/media?parent=181"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/categories?post=181"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.compdigitec.com\/labs\/wp-json\/wp\/v2\/tags?post=181"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}