Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript XML
How i can read XML file from url (http://www.website.com/xmlfile.xml) using JavaScript
Posted 2-Feb-13 21:44pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

It does not work like this here.
 
Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.
Members will be more than happy to help like this.

 

I will provide you a hint on it. Read about XMLHttpRequest (traditional Ajax). using it, you can send a request to URL and get back the response as an XML. Try out.
  Permalink  
Comments
engmebeed at 3-Feb-13 4:09am
   
Thanks for replay:
I have try to use it like:
function createCORSRequest(method, url) {
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
xhr.open(method, url, true);
} else if (typeof XDomainRequest != "undefined") {
xhr = new XDomainRequest();
xhr.open(method, url);
} else {
xhr = null;
}
return xhr;
}
And there are some error could you help??
Sandeep Mewara at 3-Feb-13 4:17am
   
Have a look at these for XMLHttpRequest:
XMLHttpRequest Object[^]
XMLHTTPRequest with Sample[^]
Using the XML HTTP Request object[^]
 
Try out!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 3 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100