开发者

toSource in internet explorer [duplicate]

开发者 https://www.devze.com 2023-01-03 16:57 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicates: Javascript toSource() method not working
This question already has answers here: Closed 12 years ago.

Possible Duplicates:

Javascript toSource() method not working

Implementing Mozilla’s toSource() method in Internet Explorer.

Is 开发者_开发问答there an alternative method toSource for internet explorer?


toSource is non standard and works in the gecko engine only, so will not work in chrome, safari or IE.

See this SO question and answers.


It is not the same as toSource() but json2.js has JSON.stringify() which will convert a JavaScript object to JSON. This won't convert everything that .toSource() will. It doesn't for instance deal with functions.

0

精彩评论

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