Solved

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

Posted on 2013-06-21
4
357 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to dynamically set the form action using jQuery.
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)

739 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