开发者

cross domain xml read

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜