function(catchError) {
try {
var firstname = prompt("please enter your first name");
}
catch (error) {
alert(error.message);
}}
1. how can I remove this problem
2 also make this work in google chrome
prompt
will return null
if cancel or the escape key is pressed. Just check for it:
var firstname = prompt("please enter your first name");
if(firstname !== null) {
} else {
// ESC or cancel pressed
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.