0

I want to call the Google API to access YouTube lists, using the Google documentation I am referencing the script on my web page:

<script src="https://apis.google.com/js/client.js?onload=onClientLoad"></script>
<script>
  function onClientLoad() {
      alert(1);
  }
</script>

The onload function is never called, I am not sure what I am missing?!

I am trying to use the solution with an API KEY, but according to the documentation, I need to provide the API Key after the onClientLoad is called...

sam360
  • 1,121
  • 3
  • 18
  • 37

1 Answers1

0

Found the answer, it was a honest mistake!

Needed to change the order of the script tags:

   <script>
      function onClientLoad() {
      alert(1);
      }
   </script>
   <script src="https://apis.google.com/js/client.js?onload=onClientLoad"></script>
sam360
  • 1,121
  • 3
  • 18
  • 37
  • It would have been nice if the Google JS would have thrown an exception that "i don't find the onClientLaod function! – sam360 Aug 20 '14 at 12:58