Take the 2-minute tour ×

How do I implement the onClick event on my blog menu in such a way that when the user clicks the button it will call a javascript function on my blogger template that the gets the most viewed or popular post?

How to implement this snippet below:

<script type="text/javascript">
function getYpipePP(feed) {
     var i;
        var pTitle = feed.value.items[i].title;
 <script src="http://pipes.yahoo.com/pipes/pipe.run?YourBlogUrl=http://www.MYURL.com&ShowHowMany=10&_id=390e906036f48772b2ed4b5d837af4cd&_callback=getYpipePP&_render=json" 

I want to implement this on blogger, but one of my blogs does not support this kind of code. So, my idea is to put an onClick on a link then call a function that contains the modified code above and redirect the user or alike to the most popular post.

share|improve this question

1 Answer 1

Create a mostPopulars()-function and call it from LI.

var pList = "<LI onclick=\"mostPopulars();\">" ...
share|improve this answer
I am new to javascript sir can you focus your answer in finding the most popular post. Honestly I am really confuse on how to edit the code above. Thank you. –  rahstame Jan 29 '12 at 12:36
Sorry, I thought that you have that function already. Without seeing more code it's hard to say anything. –  Teemu Jan 29 '12 at 13:18

Your Answer


