开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜