BEST VIEW with FireFox 3.5x

14.2.09

Tabel of Content Google Ajax API


This is another Table of Content that generate using dynamic feed - Google Ajax search API.
You can learn more Google Ajax Here.
This article has related to my last post : Table of Content With Feed :sleep:
Copy the code below to your HTML element.

<!-- Copyright (c) 2008 Google Inc.
You are free to copy and use this sample.
License can be found here: http://code.google.com/apis/ajaxsearch/faq/#license
--> <script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script type="text/javascript">
google.load("gdata", "1.x", { packages : ["blogger"] });
</script>
<script type="text/javascript">
function _run() {
var content = document.getElementById('content');
var bloggerService =


new google.gdata.blogger.BloggerService('com.appspot.interactivesampler');
var feedUri = 'http://vista-sg.blogspot.com/atom.xml?redirect=false&start-index=1&max-results=999';
var handleBlogPostFeed = function(postsFeedRoot) {
var posts = postsFeedRoot.feed.getEntries();
var html = '';
html += '<dl>'
+ '<dt><strong>TOC:</strong> '
+ '<a href="'
+ postsFeedRoot.feed.getLink('alternate').getHref()
+ '">'
+ postsFeedRoot.feed.getTitle().getText()
+ '</a></dt>';
html += '<dd><ul>';
for (var i = 0, post; post = posts[i]; i++) {
var postTitle = post.getTitle().getText();
var postURL = post.getHtmlLink().getHref();
html += '<li><a href="' + postURL + '" target="_blank">'
+ postTitle
+ '</a></li>';
}
html += '</ul></dd>';
content.innerHTML = html;
};
var handleError = function(error) {
content.innerHTML = '<pre>' + error + '</pre>';
};

bloggerService.getBlogPostFeed(feedUri, handleBlogPostFeed, handleError);
}
google.setOnLoadCallback(_run);
</script>
<div id="content" style="width:100%;"><i>Wait for Loading...</i></div>
Get in<a href="http://vista-sg.blogspot.com/2009/02/table-of-content-google-ajax-api.html/">Vista Tweak Blogger Hack</a>

* You have to change the Red color to your own domain.
* When refresh your blog or opening your site, wait for a few seconds for the Google API to load, it will shows the progress words : Wait for Loading... then it will disappear if the API have been fully loaded and will show all your list content without date, month even year.
Thank you.
Give me comment after you have tried this.tepuktangan

0 comments:

:) ;) :D :X :P :* =(( :O X( B-) :-)) =)) O:-) :-B =; i-) 8-| :-$ :[-( =P~ :(|) @};- %%;- (~~) ~o) 8-X [-X :-@ :-J (*) :-C :-?? %-( :-Q :BZ

Post a Comment

DON'T SPAM - YOU CAN WRITE COMMENTS WITH ANY LANGUAGE
THANK YOU

 
VISTA SG © 2008-2009 All rights reserved. Powered By Vista SG - Top Informative Blog | Contact Us | WebMaster Account | Edit Acc | Go ToP