开发者

cross domain xml read

开发者 https://www.devze.com 2023-04-08 00:48 出处:网络
I want to get xml data from the foreign domain using ajax,But without using Proxi. Is there any way to get xml data using ajax. Actually I want to do something like this:

I want to get xml data from the foreign domain using ajax,But without using Proxi. Is there any way to get xml data using ajax. Actually I want to do something like this:

enter code here



jQuery.getScript("http://m.jbv.no/mobile/stopmonitoring/xml/OSL",function(data, textStatus){
console.log(data); //data XML returned 
console.log(textStatus); //success
console.log('Load was performed.');
});


$.ajax({url: "http://m.jbv.no/mobile/stopmonitoring/xml/OSL",  dataType:'html',  crossDomain:true,  error:function(jqXHR, textStatus, errorThrown)  {   alert(jqXHR)  },  success: function(da开发者_开发技巧ta){    alert(data)  }});


You can use easyxdm javascript library for communicating between crossdomains. I used this library for fixing the width, height of iframe or any other element that resides on other domain there was no other way for communicating to other domain because of security reasons. May be this can help you. So here is a link:

http://easyxdm.net/wp/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号