nameless
nameless

Reputation: 809

xml in jquery in client side without webserver?

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" ));   
 });
 });

Upvotes: 2

Views: 790

Answers (1)

Rafay
Rafay

Reputation: 31033

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.

Upvotes: 3

Related Questions