jQuery.createXMLDocument = function(string) {
    var browserName = navigator.appName;
    var doc;
    if (browserName == 'Microsoft Internet Explorer') {
        doc = new ActiveXObject('Microsoft.XMLDOM');
        doc.async = 'false'
        doc.loadXML(string);
    } else {
        doc = (new DOMParser()).parseFromString(string, 'text/xml');
    }
    return doc;
}




$(document).ready(function(){
        $.ajax({
            type: "get",
            cache: false,
            url: "/CommonAssets/WebRequests.aspx?u=http%3a%2f%2flesliewelton.blogspot.com%2fatom.xml",
            
            /// The response is "atom", anything else may error out.
            dataType: "atom+xml",
            
            success: function(msg) {
                Populate(msg);
            },
            error: function() {
                alert("Error pulling RSS");
            }
        });

});



function Populate(xml) {
    var myHTMLOutput = '';

    /// Parsing the text so it becomes an XML object.
    xml = $.createXMLDocument(xml);


    // Run the function for each student tag in the XML file
    $(xml).find('entry').each(function(i) {

        var title = $(this).find("title").text();
        var content = $(this).find("content").text();
        var date1 = $(this).find("published").text();
        var date = date1.split("T");
        var mydata = '<div class="blogposts"><div class="anchorshown"><strong>' + title + '</strong><span class="date">' + date[0] + '</span><hr></div><div class="container"<br>' + content + '</div><div class="clear"></div></div>';
        myHTMLOutput = myHTMLOutput + mydata;
if(i == 1) {
return false;
}

    });
    
    // Update the DIV called Content Area with the HTML string
    $("#Temp").append(myHTMLOutput);


} 