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...

4

1 回答 1

0

找到了答案,这是一个诚实的错误!

需要更改脚本标签的顺序:

   <script>
      function onClientLoad() {
      alert(1);
      }
   </script>
   <script src="https://apis.google.com/js/client.js?onload=onClientLoad"></script>
于 2014-08-20T04:01:09.710 回答