example did not work as expected
Showing the changes to interface/src/scripting/WindowScriptingInterface.h (1 of 1 file). Show all
Unified · Split
| @@ -112,10 +112,10 @@ public slots: · 111 unmodified lines | |||
| 112 | * @function Window.prompt | 112 | * @function Window.prompt |
| 113 | * @param {string} message - The question to display. | 113 | * @param {string} message - The question to display. |
| 114 | * @param {string} defaultText - The default answer text. | 114 | * @param {string} defaultText - The default answer text. |
| 115 | * @returns {string} The text that the user entered if they select "OK", otherwise "". | 115 | * @returns {string} The text that the user entered if they select "OK", otherwise null. |
| 116 | * @example <caption>Ask the user a question requiring a text answer.</caption> | 116 | * @example <caption>Ask the user a question requiring a text answer.</caption> |
| 117 | * var answer = Window.prompt("Question", "answer"); | 117 | * var answer = Window.prompt("Question", "answer"); |
| 118 | * if (answer === "") { | 118 | * if (answer === null) { |
| 119 | * print("User canceled"); | 119 | * print("User canceled"); |
| 120 | * } else { | 120 | * } else { |
| 121 | * print("User answer: " + answer); | 121 | * print("User answer: " + answer); |