PDA

View Full Version : Cross sites http request?



midshipman
5 Aug 2011, 2:23 AM
I want to read a html page on remote server on different domain, is it a way to do this?

Thanks a lot!

alanr1
5 Aug 2011, 6:37 PM
you can't read it directly because of browser security

you may be able to use jsonp if you need to get data from another site

if this is for dev purposes only, you can lower the security on chrome or whatever browser you are using by passing a command line option to disable security

alan

NickT
6 Aug 2011, 6:55 AM
you can use Ext.data.ScriptTagProxy. That allows you to do a GET from another domain.

appsandcheese.com
6 Aug 2011, 10:17 AM
Depending on what you're trying to accomplish you could use an iframe



html : '<iframe src="http://www.sencha.com" width="450" height="100"></iframe>'




appsandcheese.com

midshipman
10 Aug 2011, 2:16 AM
I tried with 'Chrome --disable-web-security', but it does not work...

midshipman
10 Aug 2011, 2:44 AM
ScriptTagProxy can only get json or xml data from another domain and require some work on remote server to generate the data in right format. But what I want is the whole html page content and then parse it to get certain information.

Any other ideas? Thanks


you can use Ext.data.ScriptTagProxy. That allows you to do a GET from another domain.

appsandcheese.com
10 Aug 2011, 6:42 PM
In this case I think your best approach is to create a proxy on your own server, have it get the page you want, scrap the data and just send the data over to your application as opposed to loading entire page to your application, parsing it and stripping the data on the client.