weixin_33722405 2011-09-28 09:59 采纳率: 0%
浏览 61

跨域xml读取

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(data){    alert(data)  }});
  • 写回答

1条回答 默认 最新

  • weixin_33719619 2011-09-28 10:44
    关注

    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/

    评论

报告相同问题?

悬赏问题

  • ¥88 实在没有想法,需要个思路
  • ¥15 MATLAB报错输入参数太多
  • ¥15 python中合并修改日期相同的CSV文件并按照修改日期的名字命名文件
  • ¥15 有赏,i卡绘世画不出
  • ¥15 如何用stata画出文献中常见的安慰剂检验图
  • ¥15 c语言链表结构体数据插入
  • ¥40 使用MATLAB解答线性代数问题
  • ¥15 COCOS的问题COCOS的问题
  • ¥15 FPGA-SRIO初始化失败
  • ¥15 MapReduce实现倒排索引失败