Get cross domain Xml data using jQuery

Hi guys, is there a way to load XML data into a cross domain using jQuery (= client side)?

$.get('http://otherdomain.com/data.xml', function(xml) { }

The above doesn't work - should I rely on JSONP, or is there a way to load XML?

+3
source share
4 answers

You need to use JSONP .

+1
source

Unable to load XML. So yes, using the "standard" xmlhttprequests you need JSONpadding.

"" (CORS)", . , XmlHttpRequest ( "Origin" ) , .

+2

, Chrome jsonp .

json -, jsonp xml , jsonp.

, Yahoo Query Language api .

xml.

, , .

, url yahoo api encodeURI. getJSON jQuery, raw xml.

0

, php-, file_get_content curl ( Php/ROR dev, ). , XML- ,

, AJAX, curl file_get_content HTTP- Ajax .

XML- AJAX.

-1

Source: https://habr.com/ru/post/1747819/


All Articles