Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jQuery.support.cors = true #1

Closed
aroc opened this issue May 27, 2013 · 2 comments
Closed

jQuery.support.cors = true #1

aroc opened this issue May 27, 2013 · 2 comments

Comments

@aroc
Copy link

aroc commented May 27, 2013

Hey there,

First of all, your a live saver. Thanks so much for writing this. Our team has to support IE8+ and cross domain requests has been a crappy issue to deal with.

This library seems to work perfectly so far, however I needed to set jQuery.support.cors = true to get it to work properly.

Not sure if this is the case for many other people, but it might be worth looking into adding it right beside useXDomainRequest = true;

@victorquinn
Copy link
Owner

Hey aroc,

Thanks for the kind words.

The intent there was to defer to jQuery.support.cors to figure out whether a particular browser would support cors. This should be true for most modern browsers and false for IE7/8/9 (and any other browser that doesn't support cors of course).

It's not intended to be set, only read, it's a result of jQuery's internal test to see whether a given browser supports cors. See: http://vq.io/12fvcQj

$.support.cors contains the result of a test that tests whether or not the current browser supports cors. changing it doesn't make the browser support cors.

If the browser does not support cors, then my library tries to use IE's XDomainRequest object to make the cors request. Setting it to true is just overriding that check within jQuery so it always returns true which is bound to have some funny side effects.

So I'm a bit confused at how setting it is making things work for you. The only result in doing so would be to bypass use of IE's magic cross domain request object in my library, thereby making any cross domain requests on IE fail.

In any event, if you can give me a bit more info, a code snippet, or a pull request I can look into this, otherwise it sounds like you probably want to check a bit more about your IE support as I suspect it's probably not working as expected.

@aroc
Copy link
Author

aroc commented May 31, 2013

Hey @victorquinn - you're absolutely right about the $.support.cors thing. I still remained unable to get this plugin working without it, so I switched to using this project: https://github.com/MoonScript/jQuery-ajaxTransport-XDomainRequest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants