I created an application that works great on iOS and on all Android devices, except for those that run Jellybean. I tested Nexus 7, Nexus 5 and Galaxy Note 3 (KitKat) and it works great. However, when I tried this on Galaxy Note 2, Galaxy Note 3, and Galaxy S3, all running Jellybean got the same errors:
Uncaught TypeError: Illegal constructor:82
Uncaught Error: UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0: 71
On line 82, I have:
var a = new window.Event(trigger);
and on line 71 I have:
elem.dispatchEvent(a);
This application is completely web based and does not have its own plugins. So when I open a webpage in a browser, everything works fine on Jellybean phones. However, as soon as the same code is wrapped in telephone entries, I begin to see errors. What is the correct way to create custom javascript events for Jellybean?
:
. jellybean : https://developer.mozilla.org/en-US/docs/Web/API/document.createEvent
var event = document.createEvent('Event');
event.initEvent('build', true, true);
document.addEventListener('build', function (e) {
}, false);
document.dispatchEvent(event);