What's up with this:
if (success = true) {
?
, "success" true, correct? , "success" true, :
if (success === true) {
3 .
, :
function afterEmail(event) {
$(event.currentTarget).trigger(event.type);
}
function collectEmail(event) {
console.log("Collecting email");
if (success === true){
afterEmail(event);
} else {
failFn();
}
}
function authentication(event) {
if (success === true) {
collectEmail(event);
} else {
failFn();
}
}
jQuery("a.callbacktesting").click(function (event) {
if (success === false) {
event.preventDefault();
event.stopImmediatePropagation();
authentication(event);
}
});
DOM, jQuery.trigger . , .