Im getting an error 200 in my ajax request. Im wanting to post 1 value which is a email address to the page in my ajax request. Could someone tell me what is wrong
Error:
message=:[object Object], text status=:parsererror, error thrown:=SyntaxError: JSON.parse: unexpected end of data
just changed to $.parseJSON it works with no error but the success function doiesn't alert JQuery
$('#checkemail').click(function() {
var json = $.parseJSON({ "email": $('#email').val() });
$.ajax({
url:'http://' + location.host + '/buyme/include/getemailaddress.php',
type:'POST',
contentType: "application/json; charset=utf-8",
data: json,
dataType:"json",
success: function(msg) {
alert(msg);
},
error: function(msg, textStatus, errorThrown) {
alert( 'message=:' + msg + ', text status=:' + textStatus + ', error thrown:=' + errorThrown);
}});
});