vendredi 10 avril 2015

AJAX request not sending to URL


Vote count:

0




I tried to send an ajax request to a URL, expecting to get a json response, however, the request doesn't seem to be sending to /login. Instead, it remains on the current url and add the formData params to it. It is also not sensing "POST". What's wrong:



$(document).ready(function() {
$("#login").click(function() {
var formData = {username: username, password: password}
$.ajax({
type: "POST",
url: "/login",
dataType: 'json',
data: formData,
success: function (data) {
var json_x = data;
alert(json_x['data']);
}
});
});
});


asked 1 min ago







AJAX request not sending to URL

Aucun commentaire:

Enregistrer un commentaire