Skip to content
This repository has been archived by the owner on Apr 16, 2019. It is now read-only.

error in .trigger() function #28

Closed
yamalight opened this issue Jan 22, 2012 · 1 comment
Closed

error in .trigger() function #28

yamalight opened this issue Jan 22, 2012 · 1 comment

Comments

@yamalight
Copy link

if you use .trigger() with string (e.g. $(document).trigger('init')) you'll get: Uncaught Error: UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0.
Function checks if the event argument is string and creates new event from string, but line that replaces string with new event is missing (marked with +)

if (typeof (event) === "string") {
    var evtName = event;
    var newEvent = document.createEvent("Event");
    newEvent.type = evtName;
    newEvent.target = this[0];
    newEvent.initEvent(evtName, false, true);
+   event = newEvent;
}
@imaffett
Copy link
Contributor

Thanks for this. We've had it fixed locally but haven't done a push. Oddly for some reason, the code ran fine on tests on one machine, but failed on another.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants