返回首页

如何保持AJAX刷新后加载!|大家好!在这里再次与一个小问题!

我将直去点!

<html>

<head>

<script type="text/javascript">

function loadXMLDoc()

{

	var xmlhttp;

	if (window.XMLHttpRequest)

	  {// code for IE7+, Firefox, Chrome, Opera, Safari

	  xmlhttp=new XMLHttpRequest();

	  }

	else

	  {// code for IE6, IE5

	  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

	  }

	xmlhttp.onreadystatechange=function()

	  {

	  if (xmlhttp.readyState==4 && xmlhttp.status==200)

		{

		document.getElementById("test").innerHTML=xmlhttp.responseText;

		}

	  }

	xmlhttp.open("GET","info.php",true);

	xmlhttp.send();

 

}

</script>

 

</head>

 

<body>

 

<div id="test"><h2>This is where the new text will be displayed</h2></div>

<button type="button"  枚nClick="loadXMLDoc()">Change Content</button>

 



</body>

</html>

 

这里是我info.php文件在同一目录!!

{C}现在的事情是,一切工作正常,当我按一下按钮,DIV是改变了我的结果是PHP文件。但是,当我刷新页面,它会在原始阶段!!
我想保持它info.php文件后刷新! | forgotten_tarek |标记Nischalke

回答