-
15 Oct 2012 9:14 AM #11
Is anyone other than mitchell getting it to work with 4.1.1? I'm using 4.1.1a and it's still behaving problematically. But I could just be doing something wrong.
-
15 Oct 2012 10:41 AM #12
Just to make sure it wasn't my own fault, I used geron's example above. Same result as before. The XMLHttpRequest succeeds while the Ext.Ajax.request fails. Error in Chrome is "XMLHttpRequest cannot load (my url here). Request header field X-Requested-With is not allowed by Access-Control-Allow-Headers."
-
15 Oct 2012 11:09 AM #13
Actually, I did manage to convince it to work using something someone posted in another thread. Again, geron's example, with my addition:
Without that first (undocumented) useDefaultXhrHeader setting, it fails. I think some of the cross-origin stuff Ext is trying to do just gets in the way. That's also how it seems when I turn on Fiddler (a logging proxy) and look at the request from Ext.Ajax vs XMLHR.Code:Ext.Ajax.useDefaultXhrHeader = false; // without this it fails Ext.Ajax.request({ url: urlx, method: 'GET', cors: true, // this is actually still ignored success: function(response) { console.log('ExtJS.Ajax, cross domain request: success!'); }, failure: function(response) { console.log('ExtJS.Ajax, cross domain request: failure!'); } });
I also find that the cors:true does nothing and it works equally well with cors:false.
-
20 Nov 2012 6:23 AM #14
I'm using Ext JS Ext JS 4.1.1, and CORS doesn't ever work on IE 8
Also on Firefox and Chrome, the next two lines of code doesn't affect anything.
orCode:Ext.Ajax.cors = true;
Code:Ext.data.Connection.cors = true;
CORS only work on Firefox or Chrome using ONLY the line below ( before Ext.Ajax.request() method call):
Code:Ext.Ajax.useDefaultXhrHeader = false;
-
20 Nov 2012 6:29 AM #15Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
When I do CORS (yes, IE9 be older won't work) all I do is add the two headers server side and things will work without setting anything in JavaScript.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
20 Nov 2012 7:02 AM #16
Hello rstuart,
I have used your code and It works fine for me to use CORS on IE8
but I have to add both below lines not only the second
If I used only the second, IE8 fires Access is denied ErrorCode:Ext.Ajax.cors = true; Ext.Ajax.useDefaultXhrHeader = false;
However when i tested it on Firefox and Chrome it, it didn't work, you just have a little bug in your code, you forgot to add "()" on calling getAllResponseHeaders() method.
-
12 Dec 2012 9:24 AM #17
still not working ie8
still not working ie8
Guys, great effort on the hacks, I have implemented them and got slightly further than I was before.
However, I am still struggling with my system. I need some extra clarification on the CORS option. Looking through the extjs code it says only when CORS is true does it send a XDR otherwise it doesn't.
Essentially, what I'm asking is, does the cor configuration actually help for IE8 in any way or is it just detrimental?
Thanks.
-
29 Jan 2013 4:18 AM #18
I too am in the process of getting CORS working with a Sencha Touch app.
CORS is not support in IE < 10, so IE8 or 9 will not work
You found a bug! We've classified it as
EXTJSIV-5799
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote