2013-01-18 231 views
-2

这里我试图使用Ajax加载一些数据。 在IE 9和所有其他浏览器工作正常。 但是在IE8中它总是会被捕获。我不是为什么它总是引发异常。jquery只能在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; 
+7

你为什么要评估整件事?这对我来说似乎很疯狂。 –

+1

+1我同意'eval'没有意义。 –

回答

3

请勿使用eval。你的代码部分没有意义。

相关问题