ReferenceError: window is not defined (line 175, file "Code")

349 views
Skip to first unread message

burtran...@gmail.com

unread,
Jan 16, 2021, 4:02:46 PM1/16/21
to Google Apps Script Community
Trying to implement a virtual keyboard from dcode at Codepen. The error is coming up in the last function on the page. Can anyone spot the reason?

burtran...@gmail.com

unread,
Jan 16, 2021, 5:28:55 PM1/16/21
to Google Apps Script Community
I think it has to do with the difference between Vanilla JS and GAS. Can anyone offer some pointers on how to reformat this function to serve the code in GAS?

Original JS
window.addEventListener("DOMContentLoaded", function () {
    Keyboard.init();
});


Adam Morris

unread,
Jan 16, 2021, 9:53:51 PM1/16/21
to google-apps-sc...@googlegroups.com
window.addEventListener is client-side code, but since that's where you put doGet that should be server side.

On Sun, Jan 17, 2021 at 5:02 AM burtran...@gmail.com <burtran...@gmail.com> wrote:
Trying to implement a virtual keyboard from dcode at Codepen. The error is coming up in the last function on the page. Can anyone spot the reason?

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/addbd162-b20f-457e-8a86-131e596a8296n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages