Error when trying to get the URL of a page in a Google Apps Script -
i writing google apps script embedded google sites retrieve names , urls child pages of current page. when call geturl() function getting following error:
'typeerror: cannot find function geturl in object webpage.'
my code follows:
function doget() { var app = uiapp.createapplication(); var pages = sitesapp.getactivepage().getchildren(); (var = 0; < pages.length; i++) { logger.log(pages[i].geturl()); } return app; }
i new google apps scripts struggling work out means. appreciated.
use pages[i].geturl()
you should use autocomplete feature in script editor avoid such typing errors (control space after dot : page[i].here type ctrl space , you'll see possible methods...)
note : general rule in javascript use called camelcase format : getrange
, createlabel
... there few exceptions sethtml
every rule must have exceptions doesn't ?
Comments
Post a Comment