开发者

$.ajax json throwing object Error in IE7 but works in IE8

开发者 https://www.devze.com 2023-02-08 16:56 出处:网络
I have an application that using $.ajax to get json from a ColdFusion component (local).This works fine on FF and IE8 and IE9 but when I load the page in IE7 I get errors. The error is parseerror [obj

I have an application that using $.ajax to get json from a ColdFusion component (local). This works fine on FF and IE8 and IE9 but when I load the page in IE7 I get errors. The error is parseerror [object Error] when I output textStatus and errorThrown. Any ideas as appreciated. Thanks

$.ajax({ 
        type: "POST", 
        url: "/SavedLists.cfc?wsdl&method=getListsAndItems&returnformat=json&queryformat=column",  
        dataType: "json", 
        success: PopulateSharedLists,       
        error: function(XMLHttpRequest, textStatus, errorThrown) { 
             alert("Error Shared L开发者_运维知识库ists- " + textStatus + " " +errorThrown); 
             this; 
        }
    }); 


From javascriptkit.com Use JavaScript's eval() function to convert the data into an actual JavaScript object. The advantage of this is that it works in older browsers (FF3 and below, IE7 and below, Opera 10 and below). The disadvantage is that it's slow and potentially unsafe unless you pre-screen the data for malicious code/ methods that could be brought to life using eval().

0

精彩评论

暂无评论...
验证码 换一张
取 消