Solved

How do you add a "load more videos" button

Posted on 2013-06-14
4
350 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
  • 2
  • 2
4 Comments
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
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
Comment Utility
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 500 total points
Comment Utility
0
 

Author Closing Comment

by:smfmetro10
Comment Utility
Outstanding! Thanks!
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now