I\'m trying to submit a form witch sends an email:
JS
var that = $(this);
$.ajax({
url: \'../wp-content/themes/bsj/php/validate.php\',
I had the same problem;
textStatus = 'error'
errorThrown = (empty)
xhr.status = 0
That fits my problem exactly. It turns out that when I was loading the HTML-page from my own computer this problem existed, but when I loaded the HTML-page from my webserver it went alright. Then I tried to upload it to another domain, and again the same error occoured. Seems to be a cross-domain problem. (in my case at least)
I have tried calling it this way also:
var request = $.ajax({
url: "http://crossdomain.url.net/somefile.php", dataType: "text",
crossDomain: true,
xhrFields: {
withCredentials: true
}
});
but without success.
This post solved it for me: jQuery AJAX cross domain