Skip to content


Reloading WebPage using JavaScript

This section contains a lot of Scripting material for your website.

Reloading WebPage using JavaScript

Postby Web Guru » December 19th, 2008, 11:26 am

Sometimes you need to reload your webpage in javascript. If your page url contains some parameters, then you might be thinking of some complex javascript work to properly reload your webpage using javascript... But this should not be the case, javascript provide a "reload" function to trload the same page. That is accessible with document.location object.

Example
Code: Select all
document.location.reload( );


The above statement will reload the webpage along all the url parameters, etc. You can also use this fucntion alongwith the setTimeout() function if you want to delay the page re-loading.

Code: Select all
  setTimeout( function() { document.location.reload( ); }, 2000); // time in ms
User avatar
Web Guru
 
Posts: 94
Joined: March 24th, 2008, 7:59 am
Location: Lahore, Pakistan

Return to Board index

Return to Java Script / VB Script

Who is online

Users browsing this forum: No registered users and 0 guests