我的 pjax 不工作,因为我看到时间变化..
你能发现我的代码有问题吗?
<html><head>
<script src="jquery.js"></script>
<script src="jquery.cookie.js"></script>
<script src="jquery.pjax.js"></script>
<script type="text/javascript">
$('a[data-pjax]').pjax()
</script>
</head><body>
<?php
$header = "this is first part
<br/> <a href='pjax2.php' data-pjax='main'>GO</a>";
$date = date("Y-m-d H:i:s");
$footer = "this is second part";
$headers = getallheaders();
if(($headers['X-PJAX'] == 'true')){
echo "<div id='main'>first change</div>";
}else{
echo "$header<br/>$date<br /><div id='main'>first page</div><br />$footer";
}
?>
</body></html>
最佳,MJ