I'm trying to build a little google apps script to get some data from the Facebook Insight API. It's a total unfamiliar ground for me so I'm trying to build this step by step.
Until now I've only wrote the following script, I know it doesn't return anything but at last it should work so I can start asking for data :
function myFuntion() {
window.fbAsyncInit = function() {
FB.init({
appId : 'My_appid',
xfbml : true,
version : 'v2.1'
});
};
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/all.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
}
when I'm running this, I've the following error "window" is not defined.
. What does it mean ? what do I have this error ?
thanks !