Home>Article>Web Front-end> How to refresh the page in JavaScript

How to refresh the page in JavaScript

藏色散人
藏色散人 Original
2021-07-03 09:53:38 2871browse

Methods for refreshing the page in JavaScript: 1. Refresh the current document through the reload() method; 2. Replace the current document with a new document through the replace() method.

How to refresh the page in JavaScript

The operating environment of this article: windows7 system, javascript version 1.8.5, Dell G3 computer.

How to refresh the page in JavaScript?

js Refresh the current page

js Refresh the current page method:

Method 1: reload() method

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

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

location.reload();

Method 2: replace() method

replace() method can replace the current document with a new document. .

    菜鸟教程(runoob.com)  

Recommended study: "

javascript Advanced Tutorial"

The above is the detailed content of How to refresh the page in JavaScript. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn