How to stringify event object?
问题 JSON.stringify(eventObject); gives: TypeError: Converting circular structure to JSON dojox.json.ref.toJson(eventObject); gives: TypeError: Accessing selectionEnd on an input element that cannot have a selection. Is there some library/code ready to use to accomplish it ? 回答1: You won't be able to serialize an event object with JSON.stringify, because an event object contains references to DOM nodes, and the DOM has circular references all over the place (e.g. child/parent relationships). JSON