日期:2014-05-16  浏览次数:20700 次

二次使用了ajax open方法,不能刷新? - Web 开发 / Ajax
下面是js代码:
   
  url = "../ly_site_com/note_save.php?user_name="+$('user_name')+"&content="+$('content').value;

  xmlhttp.open('get',url,true);
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readystate == 4 && xmlhttp.status == 200){

msg = xmlhttp.responseText;
if(msg == 1){
alert('留言成功');
xmlhttp.open('get','../ly_site_com/index.php',true);
xmlhttp.onreadystatechange = function(){
if(xmlhttp.readystate == 4 && xmlhttp.status == 200){
$('showmessdiv').innerHTML = xmlhttp.responseText;

}
}
xmlhttp.send(null);

}else{
alert(msg);  
}


}


}
xmlhttp.send(null);

//////////////////////////////
ie弹出窗口有下面一段提示:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>

如何解决?




------解决方案--------------------
不是太会,学习中
你看看返回页面的设置,还有字符集编码是不是正确
------解决方案--------------------
note_save.php的返回,只返回所需的信息,HTML标签都去掉。