JavaScript Prompt Box Cancel Button?

后端 未结 6 1006
情歌与酒
情歌与酒 2021-01-05 07:27

I have a JavaScript function as follows:

function popup(username) {
var req = createAjaxObject();
var message = prompt(\"Message:\",\"\");
if(message != \"\"         


        
6条回答
  •  心在旅途
    2021-01-05 07:36

    var message = prompt('type any...', '');
    if(message+'.' == 'null.')
    {
        alert("you've canceled");
    }
    else
    {
        alert("type ok");
    }
    

提交回复
热议问题