Solved

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

Posted on 2013-06-21
4
353 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 82

Accepted Solution

by:
leakim971 earned 500 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
HTTPS jquery doesn't work 9 61
jQuery delay animation 3 29
How to convert from xls to xlsx using java 7 37
Javascript Form Change 5 17
What is a Lightbox? A Lightbox is the effect you see when you click, for example, an image and the screen fades out and up pops the same image but in its full size dimensions. There are lots of Lightbox effects for jQuery. Problem is they are a…
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

776 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