Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Dispatch Custom Javascript Event wiith using the new api for CustomEvent

I have an issue where i am restricted by the version of phantomJS on the server.

When our headless tests run, Im unable to use CustomEvent api in javascript as Phantom does not understand it.

In browser the code works as exepcted:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

var event = new CustomEvent("Interval", {
  detail: {
    type: 'foo',
    IntervalId: 1234,
  }
});

dispatchEvent(event);

I need to perform the same task, but by using an older method, pre CustomEvent. Is there a way to do this with the detail object intact?

>Solution :

this is what you need a polyfill for CustomEvent: https://gist.github.com/WebReflection/6693661

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading