PDA

View Full Version : JsonStore url = FQDN



catapult
12 Oct 2009, 5:59 AM
I have a requirement for a JsonStore on one domain to access a script on another domain. Is it possible to have a FQDN set as the URL that a JsonStore uses to access a script?

It seems that only a relative path works for me. When I look at the firebug console the path entered is prepended by the working domain path. Basically I need to replace http://www.domainone.com with http://www.domaintwo.com.

Any help gratefully received :D

Jack9
12 Oct 2009, 8:37 AM
You can put http://www.anysite.com in a JSON store url: param (acts as the proxy), do a store.load(), then catch the exception, defined here:
exception (http://www.extjs.com/forum/../deploy/dev/docs/source/DataProxy.html#event-Ext.data.DataProxy-exception) : ( DataProxy this, String type, String action, Object options, Object response, Mixed arg )
with a listener and dump the contents from the response.

catapult
13 Oct 2009, 12:07 AM
Thanks Jack. I'll try again.

Condor
13 Oct 2009, 12:16 AM
XSS restrictions don't allow doing XHR requests to another domain.

The only way to do cross-domain requests is by using a ScriptTagProxy instead of a HttpProxy.

Note: Read the API docs for ScriptTagProxy carefully. The server needs to respond in a very specific format.