weixin_33704234 2015-02-12 22:38 采纳率: 0%
浏览 73

jQuery从FTP请求XML

Can I use JQuery to download a XML file on a FTP server? I want to parse the file size from the XML. Use 2754 as example value.

function getPDBEFileSizeByID(pdbeID) {
    pdbeID = '2754';
    var url = "ftp://ftp.ebi.ac.uk/pub/databases/emdb/structures/EMD-" + pdbeID + "/header/emd-" + pdbeID + ".xml";

    var request = $.get(url);

    request.done(function(response) {
        var xmlDoc = $.parseXML(response);

        $fileSpecs = $(xmlDoc).find('*/map/file');
        var sizeKB = $fileSpecs.attr('sizeKb');

    });
}

Right now I am getting a CORS error. I know what it is of course, but not sure if that's an effect of JQuery or FTP.

EDIT: CORS is only available for HTTP, ok. I must integrate that on the serverside then...

  • 写回答

1条回答 默认 最新

  • weixin_33728708 2015-02-12 22:40
    关注

    CORS is only available for HTTP, ok. I must integrate that on the serverside then...

    评论

报告相同问题?

悬赏问题

  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试