JavaScript is used to make the  web pages interactive. Using java script we can do many thing without need of the server side page refresh.

Here i write how we can reload or refresh the same page using the java script.
Some times it required to web developer to refresh the page using the java script when it called the ajax method or it any purpose of timer logic etc.

refresh page using javacript

Syntax to Refresh or Reloading a Webpage using java script

JavaScript use the reload method to reload the webpage.

location.reload ();

You can change the default cache reload by setting a forceGet parameter. This will cause the browser to reload the webpage by fetching the data from the server anew instead of using the cache. This can be accomplished by using the following code: 

location.reload (true);

Example – A Web Page Refresh 



Click on the Hyperlink to Reload the Page:

<button onclick=”javascript:location.reload(true)” type=”submit” value=”Refresh Page”></button>

<a href=”javascript:location.reload(true)”>Reload Page</a>

</body> </html>

Kalpesh Patel

Founder & Owner at Aarav Web Solutions . Working for business development related to Web Design & Development. Also working with client in India & for outsourcing projects. Visit our website Aarav Web Solutions to see more about completed projects for clients. Focus in product development and we have developed our two own product listed below: Classified Website In India and Deals & Offer Website In India