Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do you add a "load more videos" button

Posted on 2013-06-14
4
Medium Priority
?
363 Views
Last Modified: 2013-06-20
Hi,

I have a webpage that loads some videos from a youtube channel.

 It works great. However, now I need a way to only show 9 at a time then have a button that when clicked will get nine more.

 I have no idea how to do this.  Any help will be greatly appreciated.

A working copy can be found at:  http://thelocalized.com/fancybox/

I have attached my code for better clarification
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
  • 2
4 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 39250136
A button : <input type="button" value="load more video" />
A global javascript parameter : currIndex = 1; // current index 1 to start
A global javascript parameter : maxRes = 9; // max results 9
An URL parameter to specify the first to load :
https://developers.google.com/youtube/2.0/reference?hl=fr#start-indexsp
An URL parameter to specify how many to load (you already have this) :
https://developers.google.com/youtube/2.0/reference?hl=fr#max-resultssp

Check this SIMPLE test page : http://jsfiddle.net/X2Fea/
0
 

Author Comment

by:smfmetro10
ID: 39263457
Thank you so much for the reply!!

Is there a way to "add" the videos,  as opposed to only show 9 at a time.

So there would be 9 then when you push the load more video button there would be 18.. and so forth?

Thanks again for the help!
0
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 39263475
0
 

Author Closing Comment

by:smfmetro10
ID: 39263516
Outstanding! Thanks!
0

Featured Post

Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.

Question has a verified solution.

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

OverviewThis article demonstrates a simple search form using AJAX. The purpose of the article is to demonstrate how to use the same code to render a page and javascript (JQuery) and AJAX to make subsequent calls to refine the results. The princip…
This article discusses how to create an extensible mechanism for linked drop downs.
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…

670 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