var postData = $('#postalCheckForm').serialize();
$.ajax({
url: "check.php",
type: "POST",
dataType: "text",
data: postData,
contentType: "application/x-www-form-urlencoded",
success: function(responseData, textStatus, jqXHR) {
if (responseData !== 'none') {
window.location.href = '';
}
},
error: function(jqXHR, textStatus, errorThrown) {
console.log(errorThrown);
}
});
I have this JavaScript ajax call. It sends the postal code to the php script and script is returning text value with response.
It is working in Firefox and in IE as expected. But not working in webKit browsers (Chrome, Safari). Instead of get response from php script page is reloaded and this string is added to URL: ?postal_input=TEST
[SOLVED] return false to the end of js.