屬性
| 屬性 | 類型 | 說明 |
|---|---|---|
Buttons | Button |
方法
| 方法 | 傳回類型 | 簡短說明 |
|---|---|---|
input | String|null | 在使用者瀏覽器中彈出含有文字輸入方塊的對話方塊。 |
input | String|null | 在使用者瀏覽器中彈出含有文字輸入方塊的對話方塊。 |
input | String|null | 在使用者瀏覽器中彈出含有文字輸入方塊的對話方塊。 |
msg | String|null | 在使用者瀏覽器中彈出對話方塊,顯示指定訊息和「確定」按鈕。 |
msg | String|null | 在使用者瀏覽器中彈出對話方塊,顯示指定訊息和按鈕。 |
msg | String|null | 在使用者瀏覽器中彈出對話方塊,顯示指定標題、訊息和按鈕。 |
內容詳盡的說明文件
input Box(prompt)
在使用者瀏覽器中彈出含有文字輸入框的對話方塊。
inputBox 方法會顯示用戶端輸入方塊,向使用者顯示指定提示。請注意,這個函式會導致伺服器端指令碼暫停。使用者清除對話方塊後,系統會自動繼續執行,但 JDBC 連線不會在暫停期間保持連線狀態。
// The code below sets the value of name to the name input by the user, or // 'cancel'. const name = Browser.inputBox('Enter your name');
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
prompt | String | 對話方塊中顯示的文字。 |
回攻員
String|null:使用者輸入的文字 (或「cancel」,表示對話方塊已取消或關閉)。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
input Box(prompt, buttons)
在使用者瀏覽器中彈出含有文字輸入框的對話方塊。
inputBox 方法會顯示用戶端輸入方塊,向使用者顯示指定提示,並提供可顯示的按鈕選項。請注意,這個函式會導致伺服器端指令碼暫停。使用者清除對話方塊後,系統會自動恢復,但 JDBC 連線不會在暫停期間保持連線。
// The code below sets the value of name to the name input by the user, or // 'cancel'. const name = Browser.inputBox('Enter your name', Browser.Buttons.OK_CANCEL);
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
prompt | String | 對話方塊中顯示的文字。 |
buttons | Button | 要使用的按鈕類型。 |
回攻員
String|null:使用者輸入的文字 (或「cancel」,表示對話方塊已取消或關閉)。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
input Box(title, prompt, buttons)
在使用者瀏覽器中彈出含有文字輸入框的對話方塊。
inputBox 方法會顯示用戶端輸入方塊,其中包含指定標題、向使用者顯示指定提示,以及提供可顯示的按鈕選項。請注意,這個函式會導致伺服器端指令碼暫停。使用者清除對話方塊後,系統會自動恢復作業,但 JDBC 連線不會在暫停期間保留。
// The code below sets the value of name to the name input by the user, or // 'cancel'. const name = Browser.inputBox( 'ID Check', 'Enter your name', Browser.Buttons.OK_CANCEL, );
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
title | String | 對話方塊的標題。 |
prompt | String | 對話方塊中顯示的文字。 |
buttons | Button | 要使用的按鈕類型。 |
回攻員
String|null:使用者輸入的文字 (或「cancel」,表示對話方塊已取消或關閉)。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
msg Box(prompt)
在使用者瀏覽器中彈出對話方塊,顯示指定訊息和「確定」按鈕。
msgBox 方法會顯示用戶端訊息方塊,向使用者顯示指定訊息。請注意,這個方法會導致伺服器端指令碼暫停。使用者清除對話方塊後,系統會自動繼續執行,但 JDBC 連線不會在暫停期間保持連線。
// The code below displays "hello world" in a dialog box with an OK button Browser.msgBox('hello world');
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
prompt | String | 對話方塊中顯示的文字。 |
回攻員
String|null - 使用者點選的按鈕文字 (小寫),或是對話方塊遭關閉時的「取消」。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
msg Box(prompt, buttons)
在使用者瀏覽器中彈出對話方塊,顯示指定訊息和按鈕。
msgBox 方法會引發用戶端訊息方塊,向使用者顯示指定訊息,並提供要顯示的按鈕選項。請注意,這個方法會導致伺服器端指令碼暫停。使用者清除對話方塊後,系統會自動恢復,但 JDBC 連線不會在暫停期間保持連線。
// The code below displays "hello world" in a dialog box with OK and Cancel // buttons. Browser.msgBox('hello world', Browser.Buttons.OK_CANCEL);
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
prompt | String | 對話方塊中顯示的文字。 |
buttons | Button | 要使用的按鈕類型。 |
回攻員
String|null - 使用者點選的按鈕文字 (小寫),或是對話方塊遭關閉時的「取消」。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
msg Box(title, prompt, buttons)
在使用者瀏覽器中彈出對話方塊,顯示指定標題、訊息和按鈕。
msgBox 方法會顯示具有指定標題的用戶端訊息方塊,向使用者顯示指定訊息,並提供可供選擇的按鈕。請注意,這個方法會導致伺服器端指令碼暫停。使用者清除對話方塊後,系統會自動恢復作業,但 JDBC 連線不會在暫停期間保留。
// The code below displays "hello world" in a dialog box with a custom title and // Yes and No buttons Browser.msgBox('Greetings', 'hello world', Browser.Buttons.YES_NO);
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
title | String | 對話方塊的標題。 |
prompt | String | 對話方塊中顯示的文字。 |
buttons | Button | 要使用的按鈕類型。 |
回攻員
String|null - 使用者點選的按鈕文字 (小寫),或是對話方塊遭關閉時的「取消」。
授權
使用這個方法的指令碼需要一或多個下列範圍的授權:
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets