This is what I have been up to..
7/03/2009
Subscribe to:
Posts (Atom)
var _yourBlogUrl = "http://paperbeatsrock.blogspot.com";
var listSize = 5;
var randomArray = new Array(listSize);
var infoArray = new Array(listSize);
var element = 0;
function getPosts() {
var script = document.createElement("script");
script.setAttribute("type", "text/javascript");
var theUrl = _yourBlogUrl +"/feeds/posts/summary?alt=json-in-script&callback=getTotalPostsCallback&start-index=1&max-results=1"
script.setAttribute("src", theUrl);
document.documentElement.firstChild.appendChild(script);
};
function getTotalPostsCallback(json) {
var totalResults = json.feed.openSearch$totalResults.$t;
if (totalResults > 0)
{
createArray(totalResults);
}
};
function createArray(totalResults) {
for(i=0; i";
for(i=0; i
";
document.getElementById("list_target").innerHTML = output;
}
/* Created by: Simon Willison http://simon.incutio.com/archive/2004/05/26/addLoadEvent */
function addLoadEvent(func)
{
var oldonload = window.onload;
if (typeof window.onload != 'function')
{
window.onload = func;
}
else
{
window.onload = function()
{
if (oldonload)
{
oldonload();
}
func();
};
}
}
// addLoadEvent(nameOfSomeFunctionToRunOnPageLoad);
addLoadEvent(function(e) {
getPosts();
});
]]>