Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How do you get and show the total count from a json call

Posted on 2013-06-21
4
Medium Priority
?
375 Views
Last Modified: 2013-06-24
Hi,

I have some javascript that scrapes a youtube channel and displays the videos on a webapage.  It displays 9 at a time with a "show more videos button.

 Is it possible to have a total count so there could be a display that read something like "showing 1-9 out of 50" then when the user hit the "load more" button it would read "showing 1-18 out of 50"?

I have included the code for better clarification and you can see the working copy at:
http://thelocalized.com/fancybox/
 
Thanks!
index.html
0
Comment
Question by:smfmetro10
  • 2
4 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 39267734
If the api provides that number the answer is yes. So you need to look in the documentation  or look at the returned Json if they already include it
0
 
LVL 83

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 39267975
data.feed.openSearch$totalResults.$t return the global nbumber of feeds

Test page : http://jsfiddle.net/X2Fea/2/
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 39268004
Yeah, I was not near a real computer.
0
 

Author Closing Comment

by:smfmetro10
ID: 39272242
Thank You So Much!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question