我对 Google Apps Script 网络应用程序有一点问题。以下脚本示例在其内部文档后可在 Web 应用程序中完美运行。但作为浏览器中的独立应用程序,我不断收到错误消息。请问如何使“Browser.msgBox(提示)”在浏览器中工作?
如果您想查看错误消息,可以在此处访问该应用程序。
// Script-as-app template.
function doGet() {
var app = UiApp.createApplication();
var button = app.createButton('Click Me');
app.add(button);
var label = app.createLabel('The button was clicked.')
.setId('statusLabel')
.setVisible(false);
app.add(label);
var handler = app.createServerHandler('myClickHandler');
handler.addCallbackElement(label);
button.addClickHandler(handler);
return app;
}
function myClickHandler(e) {
var app = UiApp.getActiveApplication();
var label = app.getElementById('statusLabel');
label.setVisible(true);
Browser.msgBox("hello world");//THIS IS MY PROBLEM!!!
app.close();
return app;
}