The following AJAX request works fine in Google Chrome
but not in Mozilla Firefox
. No hit on the target URL and no errors in the console. If I output the data from the error function I get a status code is 0 and text "error".
I've noticed that if the Ajax request URL is the same as the page's URL, it works fine.
Page URL: http://www.somedomain.com/admin/stats/
$.ajax({
url: '/admin/banners/banner_details/'+ bannerCampaignId + '?v=' + scriptVersion,
method: 'POST',
dataType: 'html',
data: {
'data[Stats]' : 'true',
'data[Banner][channel]' : channel,
'data[Banner][start_date]' : startDate,
'data[Banner][end_date]' : endDate,
'data[BannerCampaign][company_id]' : 'false'
},
success: function(html){
console.log('success');
},
error: function(data){
console.log('error');
console.log(data);
}
});
/admin/banners/banner_details/
: doesn't work
/admin/stats/banner_details/
: works
The response data is exactly the same.
I'm using jQuery v1.9.1, Google Chrome v61, Mozilla Firefox v56