Created
October 24, 2022 13:22
-
-
Save arpeggio068/e167d41e08717944736513483525fb1d to your computer and use it in GitHub Desktop.
Frontend Library
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //// start Frontend Library code.gs //////////////////////////////////////////////////////////// | |
| function includeLibrary(){ | |
| return HtmlService.createHtmlOutputFromFile("library-js").getContent(); | |
| } | |
| //// end Frontend Library code.gs ////////////////////////////////////////////////////////////// | |
| //// start Frontend Library library-js.html /////////////////////////////////////////////////// | |
| <script> | |
| function testAlert(){ | |
| alert("This is frontend library") | |
| } | |
| </script> | |
| //// end Frontend Library library-js.html /////////////////////////////////////////////////// | |
| //// start testLib_V1 code.gs //////////////////////////////////////////////////// | |
| function doGet(e){ | |
| return HtmlService.createTemplateFromFile("index").evaluate() | |
| .setTitle("home") | |
| .addMetaTag('viewport', 'width=device-width, initial-scale=1') | |
| .setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL); | |
| } | |
| function includeLibrary(){ | |
| Logger.log(fl.includeLibrary()) | |
| return fl.includeLibrary() | |
| } | |
| //// end testLib_V1 code.gs //////////////////////////////////////////////////// | |
| //// start testLib_V1 index.html //////////////////////////////////////////////////// | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <base target="_top"> | |
| </head> | |
| <body> | |
| <button onclick="testAlert()">Click</button> | |
| <?!=includeLibrary()?> | |
| </body> | |
| </html> | |
| //// end testLib_V1 index.html //////////////////////////////////////////////////// |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment