sencha extjs CROSS DOMAIN solution CORS

sencha extjs CROSS DOMAIN solution

Hi i posted this because, this problem take me hours and hours, please follow my facebook to get more post like this..

Here is the answer NO proxytag , No httpproxy, No proxy.. with ajax , no update code necesary

step 1.
add this to your webservice, you can check first if is a valide domain
header('Access-Control-Allow-Origin: *');

step2:
add to you sencha code
Ext.Ajax.cors = true;
Ext.Ajax.useDefaultXhrHeader = false;

So for example a simple form submit WORKS  without hardcoding.
                                form.submit({
                                    method: 'GET' });

Also debug any problem this with firebug

AND READY..  :)

 more info for you
CROSS DOMAIN
http://en.wikipedia.org/wiki/Same_origin_policy
http://en.wikipedia.org/wiki/Cross-Origin_Resource_Sharing
https://developer.mozilla.org/En/HTTP_access_control
Make sure you understand CORS properly before choosing to use it. If you still want to use CORS without the pre-flight OPTIONS check then you'll need to stop ExtJS mucking around with the headers. Something like this:

 

0 pensamientos:

Post a Comment

feedback!