我用ajax发送到php页面上一个请求如下:function refreshGoodsCat() {
var goods_type = document.getElementById("goods_type").value;
if (goods_type == "\u8bf7\u9009\u62e9...") {
clearGoodsCat();
clearBabyGoods();
}
var url = "index.php?" + createOnlyString(goods_type) + "&ts=" + new Date().getTime();
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleGoodsCatChange;
xmlHttp.open("GET", url);
xmlHttp.send(null);
}在php处理,返回得到的响应内容,这个响应的内容要如何发送给ajax.
我想在ajax里面用xmlHttp.responseText接收
var goods_type = document.getElementById("goods_type").value;
if (goods_type == "\u8bf7\u9009\u62e9...") {
clearGoodsCat();
clearBabyGoods();
}
var url = "index.php?" + createOnlyString(goods_type) + "&ts=" + new Date().getTime();
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleGoodsCatChange;
xmlHttp.open("GET", url);
xmlHttp.send(null);
}在php处理,返回得到的响应内容,这个响应的内容要如何发送给ajax.
我想在ajax里面用xmlHttp.responseText接收
我写过一个类似.net ICallbackEventHandler的小框架,需要我可以发给你,基于jquery and json2.
这是怎么回事啊,郁闷死了。。
echo "1";
exit();AJAX接收之后再根据返回的内容判断并提示:
if(xmlHttp.responseText=="0"){
alert('投票成功,谢谢您的参与!');
return false;
}else if(xmlHttp.responseText=="1"){
alert('对不起,你只能对此文投一次票!');
return false;
}