Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.
Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'.
Good morning, everyone. Could someone help me? I'm trying to implement export buttons at my Datatable, but when I try to click "CSV, Excel and PDF" button, I got this error "Uncaught TypeError: Failed to execute 'dispatchEvent' on 'EventTarget': parameter 1 is not of type 'Event'. at buttons.html5.min.js:formatted:122", and I really don't know what to do. It just happens at Chrome and Firefox, but IE works fine!
Edit: Oh yes, I got this error just when I open the page by a server, but when I just open the html file, it works fine in the Chrome, Firefox and IE, but, by the server, just in IE.
Answers
There appears to be another post with your error.
https://datatables.net/forums/discussion/comment/104760/#Comment_104760
Looks like the developer asked for a link to the code to troubleshoot.
I would start by verifying the versions of Datatables and buttons you have. If you can't link to your page then maybe you can provide a test case with your specific code versions and config.
Kevin
I figured out something that may help understand. I see a difference between the "offline" version of the page and the "intraweb" version, where I got the error, in the MouseEvent.
In the "offline" version, "MouseEvent" get the "click" event normally, but in the "intraweb" version, it keeps empty, and I get error just right next.
We'd really need a link to a page showing the issue please. Without that its virtually impossible to debug the problem.
Allan
My page has a lot of local file, and it's on intranet, so I don't know how send u a link.
There are other options:
https://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read#latest
I solve the problem. I modified the "MouseEvent" of the buttons.html5.min.js, deleted the "new MouseEvent('click')" and put "var evt = document.createEvent("MouseEvents");
evt.initMouseEvent("click", true, true, window, 0, 0, 0, 80, 20, false, false, false, false, 0, null);" and it works at all browsers.
What browser was this in please? I'm guessing IE? Was it running in some compatibility mode?
Allan