【【【【【求助】】】】jquery,getJSON IE6跨域请求到了,但是不返回结果。附代码。
ashx 页面
string jsoncallback = myContext.Request["jsoncallback"];
string json = "";
string username = "";
string userpic = "";
try
{
username = Tools.CookiesOperate.getCookie("_u_my");
userpic = Tools.CookiesOperate.getCookie("_u_my_pic");
}
catch { }
if (username == null && userpic == null)
{
json = "[{"status":"user_error"}]";
}
ResponseData = jsoncallback + "(" + json + ")";
context.Response.Write(ResponseData);
var url = "/Handler/Handler.ashx?action=postmsg&cnt=json&dt=" + datatype + "&id=" + data_id + "&comment=" + comment + "&pic=" + pic + "&callback=" + callback + "&title=" + title + "&repost=" + repost + "&r=" + Math.random() + "&jsoncallback=?";
$.getJSON(url, function (result) {
alert("123");
$.each(result, function (i, json) {
var data = json["status"];
$(".subcomments").html(btn_html);
if (data == "user_error") {
commentsAlert("请先登录.");
show_weibo_login();
$(".loginContainer").html("<a href="javascript:;" onclick="openQQ();" hidefocus="hidefocus"><img src="/static/images/login_btn.png"/></a>");
} else if (data == "true") {
$("#comment").val("");
commentsAlert("评论已提交.", true);
$(".loginContainer").html(htmlVal);
}
else if (data == "false") {
commentsAlert("服务器正忙.");
$(".loginContainer").html(htmlVal);
}
else if (data == "file404" || data == "wb_error") {
commentsAlert("转播微博失败.");
$(".loginContainer").html(htmlVal);
}
else if (data == "time") {
commentsAlert("您的评论过快,每次评论间隔时间为8秒.");
$(".loginContainer").html(htmlVal);
}
else if (data == "parmerro") {
commentsAlert("评论的主题已不存在.");
$(".loginContainer").html(htmlVal);
}
else {
commentsAlert("请求出错,请稍后再试。");
$(".loginContainer").html(htmlVal);
}
});
});
ResponseData = jsoncallback + "(" + json + ")";