English 中文(简体)
jquery XML不工作
原标题:jquery XML not working

http://jsfiddle.net/bpBtC/

我正在使用博客xml的饲料,但是它赢得了笔工作,可以帮助我了解哪里发生了错误或什么是失踪。

$(document).ready(function () {
    $.ajax({
        type: "GET",
        url: "http://www.blogger.com/feeds/2399953/posts/default",
        dataType: "xml",
        success: xmlParser
    });
});

function xmlParser(xml) { 
    $(xml).find("entry").each(function () {
        $(".entirecont").append($(this).find( title ).text());
    });
}

最佳回答

You need jsonp data type to be able to access cross domain ajax call. See the example below and check out what is jsonp in http://www.ibm.com/developerworks/library/wa-aj-jsonp1/

$(document).ready(function () {
    $.ajax({
        type: "GET",
        url: "http://www.blogger.com/feeds/2399953/posts/default",
        dataType: "xml",
        success: xmlParser,
        dataType: "jsonp" // add this line
    });
});

希望它有助于

附录

http://jsfiddle.net/bpBtC/1/“rel=“nofollow”

问题回答

你们正试图从你们的一边进入一个领域。 在服务器上设立代理,以检索Xml。 浏览器没有允许在javascript中交叉使用。





相关问题
ajax login using httpRequest?

I am trying to develop my login script to give feedback to the user if the login is valid or not. Basically if it isn t correct a div box will show saying its wrong, if its correct it will show its ...

Virtual Tour using sketch up, ajax, flash technologies

I want to know if there are existing technology that make your 3d models in sketch into virtual tours, using either Ajax or Flash for web presentation. If there s none, which will be a good approach ...

How can i update div continuously

I have asp.net application where i have a div which showing the value from other site. The value of that site is changing continuously. I want that my div will automatically update in some interval ...

热门标签