1

http://jsfiddle.net/bpBtC/

I am using a blogger xml feed but it won't work, could someone aid me as to where i have gone wrong or what is missing.

$(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());
    });
}

1
  • you need some kind of server side language to read and save xml on your server and then you can read it Commented Apr 16, 2012 at 23:54

2 Answers 2

1

You are trying to access a domain out side of yours. Try creating a proxy on your server to retrieve the xml. Browser's don't allow for cross domain access in javascript.

Sign up to request clarification or add additional context in comments.

Comments

0

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
    });
});

hope it helps

UPDATES

Here is updated version of your jsfiddle

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.