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