{"id":1051,"date":"2011-02-09T03:33:31","date_gmt":"2011-02-09T03:33:31","guid":{"rendered":"http:\/\/www.phpmind.com\/blog\/?p=1051"},"modified":"2011-02-09T03:33:31","modified_gmt":"2011-02-09T03:33:31","slug":"how-to-auto-refresh-a-page-through-javascript","status":"publish","type":"post","link":"https:\/\/www.phpmind.com\/blog\/2011\/02\/how-to-auto-refresh-a-page-through-javascript\/","title":{"rendered":"How to auto refresh a page through JavaScript?"},"content":{"rendered":"<p>Here is the small JavaScript example that tells how you can use setTimeout() to auto refresh page content. You can utilize this script in games site or stock sites or anywhere you can think of.<\/p>\n<pre lang=\"js\">\r\n<html>\r\n<head>\r\n<script type=\"text\/JavaScript\">\r\n<!--\r\nfunction AutoRefresh(interval) {\r\n\tsetTimeout(\"location.reload(true);\",interval);\r\n}\r\n\/\/   -->\r\n<\/script>\r\n<title>PHPMIND \u2013 Javascript Tutorials<\/title><\/head>\r\n\r\n<body onload=\"JavaScript: AutoRefresh(6000);\">\r\n\r\n<h2>JavaScript Auto Refresh Page<\/h2>\r\n<p>This code will refresh you page in 6 seconds. We have used OnLoad() Event function to call our function.\r\nNote : Please don\u2019t use a lot of auto refresh page because it is kind of annoying and your sever bandwidth will be decreasing, one way you are increasing hits to server.\r\n\r\n<\/body>\r\n<\/html>\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here is the small JavaScript example that tells how you can use setTimeout() to auto refresh page content. You can utilize this script in games site or stock sites or anywhere you can think of. PHPMIND \u2013 Javascript Tutorials JavaScript Auto Refresh Page This code will refresh you page in 6 seconds. We have used [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[27],"tags":[],"class_list":["post-1051","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1051","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/comments?post=1051"}],"version-history":[{"count":1,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1051\/revisions"}],"predecessor-version":[{"id":1052,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/posts\/1051\/revisions\/1052"}],"wp:attachment":[{"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/media?parent=1051"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/categories?post=1051"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.phpmind.com\/blog\/wp-json\/wp\/v2\/tags?post=1051"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}