Can someone help me with converting this code from zepto to jquery.
$.ajax({
url: form.attr('action'),
type: "POST",
data: data,
success: function(data, textStatus, jqXHR) {
if (data.notification) {
document.title = data.notification;
var notification = $('<div class="alert lead success"><div class="container"><i class="bi bi-check-lg"></i> ' + data.notification + '</div></div>');
notificationWrapper.append(notification);
setTimeout(function() {
notification.animate({
opacity: 0
}, 600, "ease-out", function() {
$(this).remove();
});
}, 3000);
} else if (data.errors) {
for(index in data.errors) {
var error = data.errors[index];
var notification = $('<div class="alert lead error"><div class="container"><i class="bi bi-exclamation-lg"></i> ' + error + '</div></div>');
notificationWrapper.append(notification);
setTimeout(function() {
notification.animate({
opacity: 0
}, 600, "ease-out", function() {
$(this).remove();
});
}, 3000);
};
}
if (data.redirect && data.redirect != window.location.href) {
setTimeout(function() {
window.location.href = data.redirect;
}, 1000);
} else {
setTimeout(function() {
document.title = title;
}, 3000);
}
submit.prop('disabled', false).html(submitText).removeAttr('style');
},
error: function(jqXHR, textStatus, errorThrown) {
var notification = $('<p class="error"> Error </p>');
notificationWrapper.append(notification);
setTimeout(function() {
notification.animate({
opacity: 0
}, 600, fadeOut(3000) {
$(this).remove();
});
document.title = title;
}, 3000);
submit.prop('disabled', false).html(submitText).removeAttr('style');
}
});
In Jquery I have this error:
Uncaught TypeError: S.easing[this.easing] is not a function jquery.min.js:2