0
我正在尝试学习UI服务以构建我自己的窗体(面板)。我试图复制和运行示例面板,但我无法使其工作(代码如下)。面板不会弹出。我必须在浏览器中设置某些内容吗?请帮忙。无法让UI工作
function doGet() {
// A script with a user interface that is published as a web app
// must contain a doGet(e) function.
// Create the UiInstance object myapp and set the title text
var myapp = UiApp.createApplication().setTitle('Here is the title bar');
// Create a button called mybutton and set the button text
var mybutton = myapp.createButton('Here is a button');
// Create a vertical panel called mypanel and add it to myapp
var mypanel = myapp.createVerticalPanel();
// Add mybutton to mypanel
mypanel.add(mybutton);
// Add my panel to myapp
myapp.add(mypanel);
// return myapp to display the UiInstance object and all elements associated with it.
return myapp;
}
你是怎么试这个代码?你是否已经完成了版本/部署要求? – 2014-09-29 19:18:21
您必须从发布的URL访问您的脚本,它不会在手动运行时弹出。 – 2014-09-29 19:22:21
请阅读此处的文档https://developers.google.com/apps-script/guides/web?hl=fr-FR – 2014-09-29 19:25:07