2

I am using following code in my html file and run manually not in webserver through double clicking only.it did not parse xml and give correct node value? any help please? how jquery will work if xml content is big one, because the code i have used is not having callback function, how does it identify all xml data has been recieved before parsing?

 <script type="text/javascript" src="jquery.js"></script>
 <script type="text/javascript">
 $(document).ready(function(){
 $.get("http://www.hindu.com/rss/01hdline.xml", function(response){
 var response = $.paseXML(response);
  var $xml = $(response);

 //Now you can find any xml node with $xml using various methods of jQuery
 //E.g
  alert($xml.find( "title" ));   
 });
 });

1 Answer 1

3

your success handler will not be called, place an alert of see in firebug, because of "Same Origion Policy". Also have a look at Cross-Origin Resource Sharing

what you can do is make a server side proxy, make request to the Url and get a xml response, then pass back that response to your client side where you can use jquery to parse the xml.

Sign up to request clarification or add additional context in comments.

9 Comments

i am new to java script,what is the difference between same origin and cross origin?
i am doing in mobile, cant i parse xml without server side communication except url communication?
yes you can parse it on the client end but you have to get the xml response from the server
ok.but why my code is not giving output, can u alter to give output?
your code is not giving the output because you are making a GET request from your domain say http://www.nameless.com to another domain (cross domain) called http://www.hindu.com/rss/01hdline.xml and that is not allowed
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.