Latest web development tutorials

Location reload () method

Location Object Reference Location Object

Examples

Reload the current document:

location.reload();

try it"

Definition and Usage

reload () method is used to refresh the current document.

reload () method is similar to refresh the page button on your browser.

If the parameter of the method is set to true, then no matter what the last modified date of the document, it will bypass the cache and re-download the document from the server. This user hold down Shift while clicking Jian browser's Refresh button effects are exactly the same.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support reload () method


grammar

location.reload( forceGet )

parameter

参数 类型 描述
forceGet Boolean 可选。如果把该方法的参数设置为 true,那么无论文档的最后修改日期是什么,它都会绕过缓存,从服务器上重新下载该文档。

return value

This method does not return value



Location Object Reference Location Object