我正在尝试实施Google登录并检索用户的个人资料信息.错误是:未捕获的ReferenceError:未定义gapi.这是为什么?
<!doctype html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="https://apis.google.com/js/platform.js" async defer></script>
<script type="text/javascript">
$(function(){
gapi.auth2.init({
client_id: 'filler_text_for_client_id.apps.googleusercontent.com'
});
});
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)