出于某种原因,我似乎无法在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上测试过.有没有人有任何想法我怎么能做到这一点?
编辑:
将编辑移至新问题,因为它并不特定于此.