Developer Zone
$(document).ready(function(){
showResult();
$("#sKey").click(function(){
showResult();
});
function showResult(){
var searchKey = $("#library").val().trim();
searchKey = (searchKey == '') ? "Albert+Einstein" : searchKey;
var stype=$("#stype_val").val();
$('#ptable').html("<h3>Loading...</h3>");
$.ajax({
type: "GET",
url: "http://www.stands4.com/services/v2/quotes.php?uid=UID&tokenid=TOKENID&searchtype="+stype+"&query="+searchKey,
dataType: "xml",
success: function(xml) {
var dTable = "<table class='table table-striped table-bordered'>";
dTable += '<tr><th>Quotes</th></tr>';
$(xml).find('result').each(function(){
var quote = $(this).find('quote').text();
var author = $(this).find('author').text();
dTable += '<tr><td>' + quote + '<BR> <b> - '+author+'</b></td></tr>';
});
dTable += "</table>";
$('#ptable').html(dTable);
}
});
}
});