September 2016
Beginner to intermediate
531 pages
12h 55m
English
As with Facebook, we could do manual authentication against the OAuth 2.0 endpoint, but let's make use of Google's provided API. Hooking it up is very simple:
document.addEventListener("DOMContentLoaded",
function() {
var po = document.createElement('script');
po.type = 'text/javascript'; po.async = true;
po.src = 'https://plus.google.com/js/client:plusone.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(po, s);
});This runs once the document is ready and loads the API script from Google's servers by placing a new script tag on the page just before the tag including jQuery. The loaded document contains a number of JavaScript functions that can be used to interact with Google APIs but not specifically ...
Read now
Unlock full access