I have this code:
$("#go").click(function(){
var email = $("#email").val();
var password = $("#password").val();
$.ajax({
dataType:'html',
type: 'post',
data: 'email=' + email + '&password=' + password,
url: 'login.php',
success: function(data){
alert(data);
},
error: function(data){
alert("Error");
}
});
});
which generates the following request to the server:
Request URL:http://localhost/Snotes/login.php
Request Headers CAUTION: Provisional headers are shown.
Accept:text/html, */*; q=0.01
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
Origin:http://localhost
Referer:http://localhost/Snotes/index.php
User-Agent:Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36
X-Requested-With:XMLHttpRequest
Form Dataview sourceview URL encoded
email:123
password:123
The request url is correct and the data also, but the error function is always called, in the chrome network tab it says that the status is 'canceled', can anyone help me with this error?