Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE9 "no transport" error, Firefox/Chrome work, and the request is not cross-site

I'm making a standard JQuery .ajax call, already jumped through hoops to get it working in other browsers but now I'm just stuck on IE9 (and lower, I'm sure). The page canada.example.com/registration contains a registration form, which is submitted using JQuery's .ajax:

jQuery.ajax({
    url: 'http://canada.example.com/registration.php',
    type: 'POST'
});

Note the POST request is made to http://canada.example.com/registration.php, so I'm not making a cross-site request.

This now works in Firefox and Chrome, but IE9 returns a "No transport" error like it didn't try to make the request. Any ideas on how to fix this? I've gone to some lengths to try and make this not a cross-origin request, but IE 9 still seems to think it is.

like image 370
Tom Redman Avatar asked Dec 03 '11 17:12

Tom Redman


1 Answers

Fixed it. I was passing in the fully qualified URL, i.e., canada.example.com/registration.php instead of just registration.php and also had the cross-domain flag set to yes. I removed the fully quality name so it's just sent to "registration.php" and set the cross-domain flag to NO and it works.

jQuery.ajax({
    url: '/registration.php',
    type: 'POST',
    crossDomain: false
});
like image 53
Tom Redman Avatar answered Nov 06 '22 08:11

Tom Redman