0

I want to transfer all information of an event to a server. To do so I would need to serialize the event.

This is what I tried:

var element = document.QuerySelector('div');
element.addEventListener('click', function(event) {
    console.log(event);
    console.log(JSON.stringify(event));
}, false);

But all I get is an empty dictionary: {}

Is there any way to serialize an event object in a cross browser manner?

Brian Tompsett - 汤莱恩
  • 5,753
  • 72
  • 57
  • 129
Julian F. Weinert
  • 7,474
  • 7
  • 59
  • 107

0 Answers0