如何用JS或jQuery实现网页刷新功能?
摘要:<!DOCTYPE html> <html lang="en"> <head&
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<!-- 引入jQuery -->
<script src="jq.js"></script>
</head>
<body>
<!-- 刷新按钮 -->
<button id="btn1">刷新</button>
<script>
$('#btn1').click(function(){
// 刷新页面 方法1:
window.location.reload();
// 刷新页面 方法2:
location.reload();
});
</script>
</body>
</html>
