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); } }); });
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
Post a Comment