-2

在这里,我尝试使用 Ajax 加载一些数据。在 IE 9 和所有其他浏览器中工作正常。但在 IE8 中它总是会被捕获。我不明白为什么它总是引发异常。

这是我的代码。

var SyncResponseText = "";

var WrapedRequestObject = JSON.stringify(RstClientServerDTO);


try {
    SyncResponseText = eval($.ajax({
        type: "POST",
        contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
        url: "../../ApplicationServiceHandler/ClientRequestHandler.ashx",
        data: WrapedRequestObject,
        timeout: 240000,
        dataType: "json",
        async: IsAssync,
        success: function (msg) {

//                if (msg == false) {
//                    window.location.href = window.location.href;
//                }
//                else {
                SuccessCallBack(msg);
//                }

        }, // function (data) { alert('success') },
        error: function (xhr, textstatus, error) { ErrorCallBack(xhr, textstatus,         error) } // { alert('error') }
    }).responseText);
}
catch (Exception) {
    SyncResponseText = Exception.get_Message();
}

return SyncResponseText;
4

1 回答 1

3

不要使用eval. 你的那部分代码没有意义。

于 2013-01-18T21:21:03.270 回答