를로드 할 수있는 적절한 방법은 무엇입니까 :구글 자바 스크립트 클라이언트 라이브러리와 내가 구글 자바 스크립트 클라이언트 API와 함께 연주하고 코드의 다음과 같은 두 가지의 차이점이 무엇인지 궁금 사용자 정의 엔드 포인트 클라이언트 라이브러리
//in the html file
<script src="https://apis.google.com/js/client.js?onload=gapiInit"></script>
//in a javscript file
gapiInit = function() {
alert("Loading the Libs!");
var numApisToLoad;
var callback = function(){
if(--numApisToLoad == 0) {
alert('APIs Ready!');
}
};
numApisToLoad = 1;
gapi.client.load('plus','v1',callback);
};
이 ..
<script>
// Asynchronously load the client library
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/client:plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();
</script>
I 클라우드 엔드 포인트의 예는 전자를 사용하는 동안 구글이 제공하는 예에서 구글 플러스 로그인이 후자를 사용하는 다양한 예제 모두 보았다 ..
정확히 똑같은 일을하는 두 가지 방법입니까? 내가 사용하는 것이 정말로 중요합니까? developer.google.com
// 끝점에서
예 -
https://developers.google.com/appengine/docs/java/endpoints/consume_js
// 플러스 로그인 (둘 다 할 것) -
https://developers.google.com/+/web/people/
// 단지 비동기 스크립트 .. -
developers.google.com/+/web/api/javascript
(dodgy 링크에 대해 유감스럽게도 스택 오버플로는 2 개 이상을 넣지 않습니다.)
어떤 통찰력이라도 대단히 감사하겠습니다.
모두에게 감사드립니다.
감사합니다보기 ...? –
또는 스크립트 태그에서'async defer'를 사용하십시오 ... 당황 할 필요가 없습니다 – vsync