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: *');

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

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

Also debug any problem this with firebug


 more info for you
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