How can I hide the password entered via a JavaScript dialog prompt?

前端 未结 9 1976
死守一世寂寞
死守一世寂寞 2020-12-01 07:44

How can I hide the password entered by a user in a dialog prompt in JavaScript? For example, using something like

var passwd = prompt(\"Enter Password : \",          


        
9条回答
  •  独厮守ぢ
    2020-12-01 08:12

    I have tried to solve the same problem in the following way:

    In the main page the user shall press a button in order to launch the request pressing a button will open a popup windows by the JavaScript command window.open("password.html","passwordRequest",windowStyleVar), where windowStyleVar may be:

    var windowStyleVar = "top=10, left=10, width=250, height=200, status=no, 
                         menubar=no, toolbar=no scrollbars=no";
    

    password.html looks like:

    
    
        Richiesta password
        
        
    
    
        
    type the password

    The window.opener.processRequest() call is very important as it returns the control to the main page forcing main page javascript to complete the intended action.

提交回复
热议问题