jQuery Ajax stuck on beforeSend [closed]
Currently having problems with jQuery Ajax calls. It's stuck at beforeSend
, no alert is sent from error or success. How come?
Code:
$('#addpost button').click(function(开发者_Python百科e) {
e.preventDefault();
var $post = $('#addpost textarea').val();
var $subject = $('#addpost input').val();
$.ajax({
url: 'plugins/loggboken/ajaxcalls/post.php',
data: { post: $post, subject: $subject },
beforeSend: function() {
$('#ajaxload').show();
},
error: function() {
$('#ajaxload').hide();
alert('Fel inträffades. Ladda om sidan och försök igen.');
},
sucess: function (d) {
$('#ajaxload').hide();
alert(d);
}
});
});
I know the Ajax is running as my ajaxload
div
is starting to show when the button is pressed.
You have spelling error at sucess
; should be success
:)
精彩评论