javascript - java script to get xml from url -


i writing js xml url not getting response.anything doing wrong?

  $(document).ready(function () {             $.ajax({             type: "get",             url: "http://www.w3schools.com/xml/simple.xml",             datatype: "xml",             success: function(response)                 {                     alert(response);                 }         });       }); 

http://jsfiddle.net/4bh0qpb1/1/

first script syntax error (") have fixed, although can't access following url http://www.w3schools.com/xml/simple.xml using ajax due cors (cross-origin resource sharing) policy.

reason cross-origin request blocked: same origin policy disallows reading remote resource @ http://www.w3schools.com/xml/simple.xml. can fixed moving resource same domain or enabling cors.


Comments

Popular posts from this blog

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -