Limitation of xml file?

Hi,
i am new to ajax and trying to figure out a file that has been created in xml. Is there a way to convert it into JSON, as JSONP can do a cross domain scripting. How can i find if the file can be retreved in JSON format instead of xml

ask the provider of the file if he also offers the data as JSON.

There is a version of XMLHttpRequest that can do cross domain as well - with both you are dependent on the other site setting up their end of the process. All cross domain communications are set up where both parties have to agree to the communication and configure their end of it.

No, JSON isn’t available

Yea but how do I go about doing it?

Then you need a Proxy. you can make your server query the remote API.

1 Like

As i am pretty new, how do i do it? Perhaps a snippet would be helpful

you make an AJAX call to your server, then the server makes a cURL/socket request to the remote API and relays (with or without modification) to your AJAX script.

personally I’d prefer a library as the PHP server-to-server communication can get a bit messy.

Posting a form elements to a page, and getting back. This is a new thing for me and i wonder how we get variables/collect them and send it to xml to fill it and get back. I know only > serialize(); is there, but what happens in javascript?

Is that a new question?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.