Skip to content Skip to sidebar Skip to footer

Running A Query And Retrieving Xml From An External Site

I am trying to use Ajax to submit a query to an external database (http://foreignserver:1234/database?query='SELECT FROM WHERE'). The query will run and create an XML file which I

Solution 1:

  • JSONP would be better for this task as JSON syntax is light especially if you have a lot of data. Also, JSONP already bypasses SOP and is purely client-side, besides the fact that the server encodes the data as JSON. However, you'd have to use JSON instead of XML.

  • If you really insist using XML, you can have your server assist you to fetch the remote page. This means the browser at your domain requests the page from your server on the same domain, then your server reads the remote page and returns it to the browser. Your server will be a proxy that bypasses SOP.

Post a Comment for "Running A Query And Retrieving Xml From An External Site"