blockly > dialog
dialog namespace
Functions
Function |
Description |
alert(message, opt_callback) |
Wrapper to window.alert() that app developers may override via setAlert to provide alternatives to the modal browser window. |
confirm(message, callback) |
Wrapper to window.confirm() that app developers may override via setConfirm to provide alternatives to the modal browser window. |
prompt(message, defaultValue, callback) |
Wrapper to window.prompt() that app developers may override via setPrompt to provide alternatives to the modal browser window. Built-in browser prompts are often used for better text input experience on mobile device. We strongly recommend testing mobile when overriding this. |
setAlert(alertFunction) |
Sets the function to be run when Blockly.dialog.alert() is called. |
setConfirm(confirmFunction) |
Sets the function to be run when Blockly.dialog.confirm() is called. |
setPrompt(promptFunction) |
Sets the function to be run when Blockly.dialog.prompt() is called. |
Variables
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[null,null,["Last updated 2024-09-18 UTC."],[[["The `Blockly.dialog` namespace provides wrapper functions for `alert`, `confirm`, and `prompt`, offering alternatives to the standard browser dialogs."],["Developers can customize the behavior of these dialogs by setting their own functions using `setAlert`, `setConfirm`, and `setPrompt`."],["`Blockly.dialog` is primarily designed to improve user experience, especially on mobile devices where browser prompts may not be ideal for text input."],["It's highly recommended to thoroughly test on mobile devices when overriding the default prompt functionality to ensure optimal user experience."]]],[]]