0

I have a simple Google Script project. The code is:

function doGet() {
  return HtmlService.createHtmlOutputFromFile('main');
}

There is also main.html (where I am having the problem):

<html>
    <head>
       <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools.js"/>
    </head>
</html>

When I publish and test the script, I get the following error in the JavaScript console:

Cannot read property 'prototype_v___' of undefined 3953020933-maestro_htmlapp_bin_maestro_htmlapp.js:54

Can anyone shed some light on this?

Halvor Holsten Strand
  • 19,829
  • 17
  • 83
  • 99

1 Answers1

1

Currently the only supported libraries are jQuery and jQuery UI. You can't use mootools.

Corey G
  • 7,754
  • 1
  • 28
  • 28
  • That's very strange. Why are they up there then? Does it say somewhere that you can't use them? Didn't see it. Very frustrating... – user1590759 Aug 10 '12 at 18:16
  • Sorry, can you please clarify: Are you saying it is >>Apps script<< that doesn't support mootools -- and that there is no problem with the mootools distribution on google's Library CDN? In that case, is Apps script somehow sanitizing my HTML? How could that be though? I'm sure I read that it can support linking to any 3rd party library? – user1590759 Aug 10 '12 at 18:39
  • 1
    It is Apps Script, and yes, it sanitizes your HTML via Caja. This is well documented here: https://developers.google.com/apps-script/html_service – Corey G Aug 10 '12 at 21:21
  • I read about that part before, but I was also pretty sure I had read you could use 3rd party libs. – user1590759 Aug 10 '12 at 21:34
  • 1
    You can use anything that passes the sanitizer. JQuery is guaranteed to work but other libs may or may not sanitize. Mootools do not pass. As a general guideline, libraries that support ES5 strict mode are more likely to pass. – Corey G Aug 12 '12 at 05:14