We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
类型:常用技巧 难度:★
为 JSON.parse() 方法写一个 polyfill,使其可以兼容低版本浏览器(IE8)
JSON.parse()
JSON.parse() 相关资料
参考答案:
!(window.JSON && window.JSON.parse) && !function(win) { win.JSON = { parse: function(str) { return new Function('return ' + str)() } } }(window);
本期优秀回答者: @AMY-Y