While I am aware that both Firefox and IE have a "same domain policy" as a security measure, I write to seek some other options to implement my requirements.
So it will be really helpful for me if anyone can guide me an alternative way to implement this kind of a functionality.
The example sses JSON to talk to an outside server. You can see the code by viewing the source of the page or looking at it in Firebug.
posted 11 years ago
---------------------------- Web Server 1 = www.abc.com ---------------------------- <script src="http://www.xyz.com/js/data.js"/>
---------------------------- Web Server 2 = www.xyz.com (data.js) ---------------------------- // Makes AJAX call to application and transforms the XML data into // HTML and then populates DIVs present in the HTML document that // invoked it.
As of now, I keep getting the "Permission Denied" error.
posted 11 years ago
JSON is rather easy, it is just like XML, only in a simple form without < and > tags. Learn JSON and you learn a new and hot skill. It will take you 5 minutes to undertand it.
Goto http://json.org/ and gives you the basic information. Look at the bottom and there is info on differnet languages.
You are not going to be able to use Ajax accross domains. You already know that, so this is your only real option unless you want the people running this code to have to run a local proxy. I doubt you would want to do that.
Actually you can run a proxy on your local server to access remote services; I went into great detail on how to do this in the Web Services chapter of Ajax in Practice.
Basically, you write a servlet (or other server-side processing unit) to access the remote service on your behalf, collect the response and relay it to your page. Because the servlet is on the server, it is not subject to the browser's cross-domain restrictions.
@ Eric: JSON does look like a neat alternative, albeit the reluctance to change from the all too familiar XML :-/ Have started learning about JSON nonetheles.
@ Bear: Yups, have already put the proxy into place. But as things have a way to get entangled, our web app is Java based while one of the users of our services has the web app running behind an IIS server. Durned I haven't got any about IIS (totally into Tomcat and Apache) and those folks aren't particularly bright with proxies. Any pointers as to where I can get some proxy related help w.r.t IIS?
Also, any ideas as to how the folks @ Google implemented their Maps application? Is it also JSON based 'coz there's no question of proxies and it is all about cross browser scripting.
Thanks a lot to all. [ November 16, 2007: Message edited by: Anirvan Majumdar ]
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad: