ie6、ie7下JSON.parse JSON未定义的解决方法

解决方法一:

[javascript]  view plain copy print ?
  1. var jsons = req.responseText;  
  2. var s;  
  3. if (typeof(JSON) == 'undefined'){  
  4.      s = eval("("+jsons+")");  
  5. }else{  
  6.      s = JSON.parse(jsons);  
  7. }  

解决方法二:

调用的页面里引用json2.js即可解决问题(推荐方法二)。

即:

 json2.js的下载地址:http://download.csdn.net/detail/icexuan007/4896080

你可能感兴趣的:(C#,asp.net)