jQuery的,$阿贾克斯和Android [英] Jquery, $ajax and Android

查看:149
本文介绍了jQuery的,$阿贾克斯和Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个code在我的网站:

i have this code on my site:

$.ajax({
        type: "GET",
        url: 'http://www.rp-online.de/cmlink/top-news-1.2513701',
        cache : false,
        dataType: "xml",
        success: function(xml) {
            $(xml).find('title').text();
            console.log($(xml).text());

            var as = $(xml).find('description').eq(1).text();
            $('#av').append(as);
        },
        error:function (xhr, textStatus, thrownError){
            console.log(textStatus);
            $("#result").html(textStatus);
        }
    });

目前,这code ++工程,其用于从其他网站(RSS源)获取数据。

For now, this code works, and its used to get data from another website ( RSS feed ).

一切看起来都在桌面上,IOS好的,但不是在Android上。
当我打开Chrome和移动模拟,我看到这个控制台:
解析错误。
是否有人知道一个解决方案吗?
谢谢。

Everything looks good on Desktop, IOS, but NOT on android. When i turn on Chrome and mobile emulation, i see this in console: parseerror. Does anybody know a solution ? Thank You.

推荐答案

我确认,即code以上将只适用于iPad,的Nexus 7的工作,但不能用于其他设备。 iPad的标头是:

I confirm, that code above will only work for Ipad, Nexus 7, but not for other devices. For Ipad header is:

状态code:200 OK
内容类型:应用程序/ RSS + xml的;字符集= UTF-8

Status Code:200 OK Content-Type:application/rss+xml;charset=utf-8

和为iPhone:
状态code:301永久移动
内容类型:text / html的

And for Iphone: Status Code:301 Moved Permanently Content-Type:text/html

这篇关于jQuery的,$阿贾克斯和Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆