I've used this basic, simplified ajax script a hundred times already, now I've been working my brains out what is wrong with it this time, why I get no response:
$('#btn-submit').click(function() {
var str = $("#form-submit").serialize();
alert(str); //alert pops up
$.ajax({
type: "POST",
url: "ajax-submit.php",
data: str,
success: function(msg) {
alert(msg); //does not show
if(msg==0) {
alert(0); //does not show
}
}
});
alert('i come after ajax'); //alert pops up
});
jQuery files inlcuded before this script, and path is right (double checked and there is no error in firebug).
Also the path to ajax-submit.php is OK, the content is <?php echo "test"; ?>
.
Has anybody an idea why this does not work?