求助 jquery ajax error firefox下没问题IE下报错

syh202 2011-05-24 02:05:52
环境
jquery Ajax
jquery 1.6

1,页面代码:
var postdata = {};
postdata.mode = 'jsonProvince';
$.ajax({
type : "POST",
url : httpUrl,
data: postdata,
cache : false,
dataType :"json",
error : remoteException,
success : function(data, dataType){
alert("88888");
}
});
function remoteException(XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status); // 信息框弹出内容 200
alert(textStatus); // 信息框弹出内容 parsererror
alert(errorThrown); // 信息框弹出内容 IE下: [object Error]
// Chrome下:syntax error unexpected token ILLEGAL
// fireFox下:正常 “88888”对话框能弹出来没问题


}


2,后台代码
$arrSelectedDeliv["error"] = "false";
$arrSelectedDeliv["html"] = "test";
echo jsonEncode($arrSelectedDeliv);

exit;
.....

function jsonEncode($value) {
if (function_exists('json_encode')) {
return json_encode($value);
} else {
require_once dirname(__FILE__) . '/../../module/Services/JSON.php';
GC_Utils_Ex::gfPrintLog(' *use Services_JSON::encode(). faster than using the json_encode!');
$objJson = new Services_JSON();
return $objJson->encode($value);
}
}
...全文
397 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangju309 2012-06-29
  • 打赏
  • 举报
回复
楼主问题解决没?
syh202 2011-05-24
  • 打赏
  • 举报
回复
没有人回答吗?
。。。。。。。。。。。。。。。。。。。。。。。。。

52,792

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧