appMobi/jQ.Mobi — Issue #28: error in .trigger() function
Author: yamalight
Created: 2012-01-22 13:36:26+00:00
State: open

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 +)

'''javascript
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;
}
'''