We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e9ae998 commit 7b1e273Copy full SHA for 7b1e273
1 file changed
javascript/search.js
@@ -0,0 +1,18 @@
1
+// After the API loads, call a function to enable the search box.
2
+function handleAPILoaded() {
3
+ $('#search-button').attr('disabled', false);
4
+}
5
+
6
+// Search for a specified string.
7
+function search() {
8
+ var q = $('#query').val();
9
+ var request = gapi.client.youtube.search.list({
10
+ q: q,
11
+ part: 'snippet'
12
+ });
13
14
+ request.execute(function(response) {
15
+ var str = JSON.stringify(response.result);
16
+ $('#search-container').html('<pre>' + str + '</pre>');
17
18
0 commit comments