PDA

View Full Version : javascript same domain policy



topcoder1
3 Aug 2007, 2:37 PM
I have 2 websites a and b, I want to parse the dom of b and make some modifications and then display it in a. But javascript same-domain policy prohibit reading of html dom's property at one domain from a different domain.
I'm pretty sure I've seen this being done at some sites but I don't recall. Can some guru enlighten me?
thanks!

jay@moduscreate.com
3 Aug 2007, 4:08 PM
use the http proxy to bypass this.

topcoder1
6 Aug 2007, 8:22 AM
can you elaborate on this a little? also I own domain a but not b.
thanks

jay@moduscreate.com
6 Aug 2007, 10:14 AM
The Proxy services provided by the ext framework give you the ability to read anything from any source including stuff in different domains.




http://extjs.com/deploy/ext/docs/output/Ext.data.HttpProxy.html


The feedviewer is a perfect example of this.
http://extjs.com/deploy/ext/examples/layout/feed-viewer.html


ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'feed-proxy.php'
}),
reader : reader
});