I have the following javascript that works fine when debugging, but doesn't work in the process due to a misconfiguration:
function buildNotification(config) {
var notificationWrapper = $('<div>', {
'id': _.uniqueId('notification_'),
'class': 'notificationWrapper'
});
var notification = $('<div>', {
'class': 'notification ui-widget ui-state-default'
});
notification.addClass(config.notificationClass);
notification.appendTo(notificationWrapper);
var notificationList = $('<ul/>', {
'class': 'notificationList'
}).appendTo(notification);
$.each(config.messages, function() {
$('<li/>', {
html: this
}).appendTo(notificationList);
});
return notificationWrapper;
}
Cookies, where I set the HTML markup of the list item based on the configuration.
The configured premium is as follows:
function g(a) {
var b = $("<div>", { id: _.uniqueId("notification_"), "class": "notificationWrapper" }), c = $("<div>", { "class": "notification ui-widget ui-state-default" });
c.addClass(a.notificationClass);
c.appendTo(b);
var d = $("<ul/>", { "class": "notificationList" }).appendTo(c);
$.each(a.messages, function() { $("<li/>", { html: this }).appendTo(d); });
return b;
}
And here is the error message I get:

Can someone throw me some knowledge? Am I doing something bad? I ran the code through JSHint, no complaints, and I also have a "strict use" at the top of the file.
UPDATE: I have the same problem when using Google Closure. The code he created is:
function g(a) {
var b = $("<div>", { id: _.uniqueId("notification_"), "class": "notificationWrapper" }), c = $("<div>", { "class": "notification ui-widget ui-state-default" });
c.addClass(a.notificationClass);
c.appendTo(b);
var d = $("<ul/>", { "class": "notificationList" }).appendTo(c);
$.each(a.messages, function() { $("<li/>", { html: this }).appendTo(d); });
return b;
}
This is identical to the YUI compressor.
2: http://jscompress.com/ , .
:
function r(e) {
var t = $("<div>", { id: _.uniqueId("notification_"), "class": "notificationWrapper" });
var n = $("<div>", { "class": "notification ui-widget ui-state-default" });
n.addClass(e.notificationClass);
n.appendTo(t);
var i = $("<ul/>", { "class": "notificationList" }).appendTo(n);
$.each(e.messages, function() { $("<li/>", { html: this }).appendTo(i); });
return t;
}