9
votes

How do I use jQuery in a script attached to a Google Spreadsheet? The Google Libraries page seems to make it simple but apparently I misunderstand the execution environment for Libraries, calling google.load() in the script fails.

So what is the right way to do this? I can imagine ideas like calls on UrlFetchApp.fetch() but that doesn't seem like the right way.

(I know I get confused with the various Google App environments, so to be clear: I'm talking about a script saved in the 'script editor' under Tools on the menu for a Google Docs Spreadsheet.)

1
I'm not sure, but I don't think you can use external scripts in Google Apps Script.Linus Thiel
You definitely can, I've seen the pattern << eval(UrlFetchApp.fetch(...url...).getContentText()) >> used to pull in third party scripts.chernevik
Let me rephrase - I don't think you're supposed to -- which your pattern clearly shows. :-PLinus Thiel
it is possible however? I'd also like to use $.(ajax) in a google script linked to a spreadsheet, to scrape a webpage.Louis
"I'd also like to use $.(ajax) in a google script linked to a spreadsheet, to scrape a webpage. – " I´m searching for the exact same thing. Did you get any where with this?!user3347814

1 Answers