简体   繁体   中英

Opening new window with google app script

What I'm doing is creating a google app script to calculate a value with the form data and then open a new window to display that number to the user. I am currently using this code but I keep on receiving the error that window is not found.

var myWindow=window.open("", "Results", "width=200, height=100"); 
myWindow.document.write("<p>Your score is "+score+" </p>");

Any suggestions/workarounds?

Assuming that you are using HtmlService in Google Apps Script. Have you checked the restriction which HtmlService imposes on certain browser objects?

Your JavaScript does not have full access to the surrounding browser. You cannot, for example, read cookies, navigate the history, or set the title of the window

Reference:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM