It appears that when one uses HtmlService.createTemplateFromFile(), the html code that is in the file is just a snippet. The method packages the snippet in an html wrapper which adds things like the DTD, and html, head, and body tags to form a complete html document. The documentation (https://developers.google.com/apps-script/guides/html/) suggests that HtmlService.createHtmlOutputFromFile() works differently. It suggests that in the later case the relevant file contains the ENTIRE html code and the method does not add a wrapper. Experimentation reveals that the later works like the former in that a wrapper is added. My question is this: Is there some way to return a snippet of html code (i.e., no wrapper) from an app-script? The reason that I ask is that I would like to be able to use AJAX to insert a snippet of code from an app-script into some point in the DOM structure. Thanks for any input.
... doug
P.S. I realize it's probably going to be a separate issue; but, it would be nice if the snippet could include a scriptlet.
Content Servicethat will return content. You would probably need to have anIf, thenstatement in yourdoGet()function that would either load your regular HTML Service, OR return content depending on a search string passed in the URL. - Alan Wells