环境winserver2003 ie8
一共有3个页面
a页面向b页面发送数据
a页面js部分
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="common.css"/>
<script src="my.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
var myXmlHttpRequest="";
function getMessage(){
myXmlHttpRequest=getXmlHttpObject();
if(myXmlHttpRequest){
var url="GetMessageController.php";
var data="getter=<?php echo $loginuser; ?>&sender=<?php echo
$username ?>";
myXmlHttpRequest.open("post",url,true);
window.alert(data);
myXmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
myXmlHttpRequest.onreadystatechange=function chuli(){
if(myXmlHttpRequest.readyState==4){
if(myXmlHttpRequest.status==200){
window.alert("dsfsd");
var cities=myXmlHttpRequest.responseXML.getElementsByTagName('city');
var city_name=cities[1].childNodes[0].nodeValue;
window.alert(city_name);
}}}
//发送请求
myXmlHttpRequest.send(data);
}else{
window.alert("失败");
}}
window.setInterval(" getMessage()",5000);
</script>
------解决思路----------------------
你不要 a页面、b页面、c页面的
既然 var url="GetMessageController.php";
那么 GetMessageController.php 是哪个?