Click here to Skip to main content
15,943,233 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Javascript , a devil spawn language. Pin
Armando de la Torre28-Oct-15 11:02
Armando de la Torre28-Oct-15 11:02 
AnswerRe: Javascript , a devil spawn language. Pin
ZurdoDev23-Nov-15 3:05
professionalZurdoDev23-Nov-15 3:05 
QuestionButton in the tree is not fired Pin
Member 785420721-Oct-15 18:34
Member 785420721-Oct-15 18:34 
AnswerRe: Button in the tree is not fired Pin
F-ES Sitecore21-Oct-15 23:35
professionalF-ES Sitecore21-Oct-15 23:35 
GeneralRe: Button in the tree is not fired Pin
Member 785420722-Oct-15 19:54
Member 785420722-Oct-15 19:54 
QuestionNeed js help! Pin
Member 1197204321-Oct-15 15:33
Member 1197204321-Oct-15 15:33 
AnswerRe: Need js help! Pin
Wombaticus22-Oct-15 0:42
Wombaticus22-Oct-15 0:42 
QuestionYouTube API - upload videos by search term Pin
Member 1207417120-Oct-15 9:49
Member 1207417120-Oct-15 9:49 
Hello,

I am making an app that displays products. Once you select a product, it shows you links to purchase it, as well as 3 review videos from YouTube. So far I have used the YouTube API to display video information, including video ID, title, etc. But I am unsure as to how to display the videos themselves. Below is my JavaScript file that displays the video information.

Could anyone tell me how to display videos based on the product name?

Thank you!

C#
// Your use of the YouTube API must comply with the Terms of Service:
// https://developers.google.com/youtube/terms

// Helper function to display JavaScript value on HTML page.
function showResponse(response) {
    var responseString = JSON.stringify(response, '', 2);
    document.getElementById('response').innerHTML += responseString;
}

// Called automatically when JavaScript client library is loaded.
function onClientLoad() {
    gapi.client.load('youtube', 'v3', onYouTubeApiLoad);
}

// Called automatically when YouTube API interface is loaded (see line 9).
function onYouTubeApiLoad() {
    // This API key is intended for use only in this lesson.
    // See https://goo.gl/PdPA1 to get a key for your own applications.
    gapi.client.setApiKey('API_KEY');

    search();
}

function search() {
    // Use the JavaScript client library to create a search.list() API call.
    var request = gapi.client.youtube.search.list({
        part: 'snippet',
        q: "paper towel review",
        maxResults: 2,
        order: "viewCount"
    });

    // Send the request to the API server,
    // and invoke onSearchRepsonse() with the response.
    request.execute(onSearchResponse);
}

// Called automatically with the response of the YouTube API request.
function onSearchResponse(response) {
    showResponse(response);
}

QuestionHow to control the do / while infinite loop? Pin
Ted.K-117-Oct-15 1:06
Ted.K-117-Oct-15 1:06 
AnswerRe: How to control the do / while infinite loop? Pin
Wombaticus18-Oct-15 11:52
Wombaticus18-Oct-15 11:52 
GeneralRe: How to control the do / while infinite loop? Pin
Ted.K-123-Oct-15 21:43
Ted.K-123-Oct-15 21:43 
AnswerRe: How to control the do / while infinite loop? Pin
Blikkies18-Oct-15 22:02
professionalBlikkies18-Oct-15 22:02 
GeneralRe: How to control the do / while infinite loop? Pin
Ted.K-123-Oct-15 21:43
Ted.K-123-Oct-15 21:43 
AnswerRe: How to control the do / while infinite loop? Pin
W Balboos, GHB20-Oct-15 7:45
W Balboos, GHB20-Oct-15 7:45 
GeneralRe: How to control the do / while infinite loop? Pin
Ted.K-123-Oct-15 21:42
Ted.K-123-Oct-15 21:42 
QuestionHow to deal with Uncaught TypeError? Pin
Ted.K-117-Oct-15 0:59
Ted.K-117-Oct-15 0:59 
AnswerRe: How to deal with Uncaught TypeError? Pin
Wombaticus18-Oct-15 21:40
Wombaticus18-Oct-15 21:40 
GeneralRe: How to deal with Uncaught TypeError? Pin
Ted.K-124-Oct-15 19:44
Ted.K-124-Oct-15 19:44 
Questionhow to check the control is available or not? Pin
HoneyBee14-Oct-15 20:45
HoneyBee14-Oct-15 20:45 
AnswerRe: how to check the control is available or not? Pin
Blikkies15-Oct-15 4:49
professionalBlikkies15-Oct-15 4:49 
Questioncheck textbox validation outside the form tag in javascript Pin
HoneyBee14-Oct-15 20:43
HoneyBee14-Oct-15 20:43 
AnswerRe: check textbox validation outside the form tag in javascript Pin
Richard Deeming15-Oct-15 2:55
mveRichard Deeming15-Oct-15 2:55 
Questionjavascript question Pin
Member 1197204310-Oct-15 13:43
Member 1197204310-Oct-15 13:43 
AnswerRe: javascript question Pin
ZurdoDev13-Oct-15 5:35
professionalZurdoDev13-Oct-15 5:35 
AnswerRe: javascript question Pin
Member 1186114821-Oct-15 3:54
Member 1186114821-Oct-15 3:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.