Re:Google's Code Editor
by selectnull on Thursday May 17, 2012 @04:54AM
(#3986074)
It is server side javascript and because of that there is not jQuery (which is client side library). You are not working with DOM, you are working with API defined by Apps Script, check the docs here https://developers.google.com/apps-script/
I get that detachment from the DOM but jQuery has useful tools beyond element selection and manipulation.
For that matter, why doesn't App Script expose an interface that expresses page components as part of a DOM? The Sheet app could provide an interface to a cell with classes for its particular column, row and sheet, allowing access with jQuery / CSS selectors. Instead users have to learn a new interface with stuff like Spreadsheeet.getRange().
And maybe they've revised the docs, but I spent a fair amount of time in them and didn't see any discussion of what JavaScript tools would not be available. I had to figure that out by trial and failure.
You can hack some of these. Scripts can import code from a remote server, which allows you to edit where you like, push to your remote server and pull it into App Script. That tool enables small libraries, I've used it to write a simple test environment. I think you could test App Script JsTestDriver et al with some kind of mock-up strategy.
I haven't enjoyed it, but it has met the client requirements and that's the main thing, right?