相关疑难解决方法(0)

Stringify DOMWindow对象

出于某种原因,我似乎无法在DOMWindow对象上使用JSON.stringify.例如:

console.log(window.self); // Outputs a hierarchical DOMWindow object
console.log(JSON.stringify(window.self)); // Outputs nothing - not even an error

alert(window.self); // Alerts "[object DOMWindow]"
alert(JSON.stringify(window.self)); // Again nothing - not even an error
Run Code Online (Sandbox Code Playgroud)

在Safari和Chrome上测试过.有没有人有任何想法我怎么能做到这一点?

编辑:

将编辑移至新问题,因为它并不特定于此.

javascript json

8
推荐指数
1
解决办法
7651
查看次数

标签 统计

javascript ×1

json ×1