Connexions Course III

by dandiebolt

HTML

<link rel="stylesheet" href="http://community.intuit.com/stylesheets/cache/site.css">
<div id="here" class="answer wrp"></div>


<br/><hr/><br/>

<h1>Client Side XML Representation</h1>
<textarea id="xml" cols="70" rows="100"></textarea>

CSS

#here {text-align:left}

JavaScript

var query = "";
query += "SELECT * ";
query += "FROM html ";
query += "WHERE url='http://community.intuit.com/posts/totaled-field-mapping' ";
//console.log("query=" + query);

var yql = "";
yql += "http://query.yahooapis.com/v1/public/yql?q=";
yql += encodeURIComponent(query);
yql += "&format=xml";
yql += "&callback=?";
//console.log("yql=" + yql);
$.getJSON(yql, function(data) {
    console.dir(data.results[0]);
    var $page = $(data.results[0]);
    $("#here").html($("#reply_bp2Xu2aoCr4AKlacwZ5xHE",$page).html());
    $("#here img").each(function(){
        $(this).attr("src","http://community.intuit.com" + $(this).attr("src"));
    });
     $("#xml").val($("#reply_bp2Xu2aoCr4AKlacwZ5xHE",$page).html());
});
//images prefix: http://community.intuit.com