属性
媒体资源 | 类型 | 说明 |
---|---|---|
Buttons | ButtonSet |
方法
方法 | 返回类型 | 简介 |
---|---|---|
inputBox(prompt) | String | 在用户浏览器中弹出带有文本输入框的对话框。 |
inputBox(prompt, buttons) | String | 在用户浏览器中弹出带有文本输入框的对话框。 |
inputBox(title, prompt, buttons) | String | 在用户浏览器中弹出带有文本输入框的对话框。 |
msgBox(prompt) | String | 在用户的浏览器中弹出包含给定消息和“确定”按钮的对话框。 |
msgBox(prompt, buttons) | String | 在用户的浏览器中弹出包含指定消息和指定按钮的对话框。 |
msgBox(title, prompt, buttons) | String | 在用户的浏览器中弹出包含指定标题、消息和指定按钮的对话框。 |
详细文档
inputBox(prompt)
在用户浏览器中弹出带有文本输入框的对话框。
inputBox 方法会引发一个客户端输入框,该输入框会向用户显示给定提示。请注意,此函数会导致服务器端脚本被暂停。该对话框会在用户清除对话框后自动恢复,但 JDBC 连接在暂停后不会保留。
// The code below sets the value of name to the name input by the user, or 'cancel'. var name = Browser.inputBox('Enter your name');不建议使用此方法。请改用界面提示。
参数
名称 | 类型 | 说明 |
---|---|---|
prompt | String | 要在对话框中显示的文本。 |
弃踢回攻
String
- 用户输入的文本(如果是已取消或已关闭的对话框,则为“cancel”)。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
inputBox(prompt, buttons)
在用户浏览器中弹出带有文本输入框的对话框。
inputBox 方法会引发一个客户端输入框,该输入框会向用户显示给定提示,并提供要显示的按钮选项。请注意,此函数会导致服务器端脚本被暂停。该对话框会在用户清除对话框后自动恢复,但 JDBC 连接在暂停期间不会保留。
// The code below sets the value of name to the name input by the user, or 'cancel'. var name = Browser.inputBox('Enter your name', Browser.Buttons.OK_CANCEL);不建议使用此方法。请改用界面提示。
参数
名称 | 类型 | 说明 |
---|---|---|
prompt | String | 要在对话框中显示的文本。 |
buttons | ButtonSet | 设置为使用的按钮类型。 |
弃踢回攻
String
- 用户输入的文本(如果是已取消或已关闭的对话框,则为“cancel”)。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
inputBox(title, prompt, buttons)
在用户浏览器中弹出带有文本输入框的对话框。
inputBox 方法会引发一个具有指定标题的客户端输入框,该输入框会向用户显示指定提示,并提供一系列要显示的按钮。请注意,此函数会导致服务器端脚本被暂停。该对话框会在用户清除对话框后自动恢复,但 JDBC 连接在暂停期间不会保留。
// The code below sets the value of name to the name input by the user, or 'cancel'. var name = Browser.inputBox('ID Check', 'Enter your name', Browser.Buttons.OK_CANCEL);不建议使用此方法。请改用界面提示。
参数
名称 | 类型 | 说明 |
---|---|---|
title | String | 对话框的标题。 |
prompt | String | 要在对话框中显示的文本。 |
buttons | ButtonSet | 设置为使用的按钮类型。 |
弃踢回攻
String
- 用户输入的文本(如果是已取消或已关闭的对话框,则为“cancel”)。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
msgBox(prompt)
在用户的浏览器中弹出包含给定消息和“确定”按钮的对话框。
msgBox 方法会引发一个客户端消息框,该消息框会向用户显示指定消息。请注意,此方法会导致服务器端脚本被暂停。该对话框会在用户清除对话框后自动恢复,但 JDBC 连接在暂停后不会保留。
// The code below displays "hello world" in a dialog box with an OK button Browser.msgBox('hello world');不建议使用此方法。请改用界面提醒对话框。
参数
名称 | 类型 | 说明 |
---|---|---|
prompt | String | 要在对话框中显示的文本。 |
弃踢回攻
String
- 用户点击按钮的小写文本(如果是已关闭的对话框,则为“cancel”)。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
msgBox(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 | ButtonSet | 设置为使用的按钮类型。 |
弃踢回攻
String
- 用户点击按钮的小写文本(如果是已关闭的对话框,则为“cancel”)。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets
msgBox(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 | ButtonSet | 设置为使用的按钮类型。 |
弃踢回攻
String
- 用户点击按钮的小写文本(如果是已关闭的对话框,则为“cancel”)。
授权
使用此方法的脚本需要获得以下一个或多个范围的授权:
-
https://www.googleapis.com/auth/spreadsheets.currentonly
-
https://www.googleapis.com/auth/spreadsheets