Jquery 刷新网页时如何保存所需文件
我有一个项目要求刷新页面,但保留另一个页面的内容,但我不确定为什么我当前的实现无法工作 我有以下3个文件: test6.phpJquery 刷新网页时如何保存所需文件,jquery,pjax,Jquery,Pjax,我有一个项目要求刷新页面,但保留另一个页面的内容,但我不确定为什么我当前的实现无法工作 我有以下3个文件: test6.php <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> <script src="https://code.jquery.com/jquery-3.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script src="https://code.jquery.com/jquery-3.4.1.js" integrity="sha256-WpOohJOqMqqyKL9FccASB9O0KwACQJpFTUBLTYOVvVU=" crossorigin="anonymous"></script>
<script src="jquery.pjax.js"></script>
</head>
<body>
<?php require_once "test10.php"?>
<div class="container" id="pjax-container">
Go to <a href="test9.php">next page</a>.
</div>
<script>
$(document).ready(function() {
$(document).pjax('a', '#pjax-container');
});
</script>
</body>
</html>
文件
去。
$(文档).ready(函数(){
$(document.pjax('a','#pjax容器');
});
test10.php
<div>
<h1>Hello</h1>
</div>
你好
test9.php
<h1>this is test9</h1>
这是test9
刷新test9时,如何保留test10的内容?我不清楚您的意思,您能详细说明一下吗?您具体希望在这里发生什么?将@David I required test10.php复制到test6.php。然后使用pjax,我用tes9.php的内容更改了#pjax容器的内容。因此,我将在顶部显示test10.php的内容,在底部显示test9.php的内容。但当我按下F5键时,test10.php的内容丢失了。所以我想要的是如何在刷新页面时保持test10.php内容。