javascript prompt for password (i.e. *******)

Deadly 提交于 2019-12-01 08:40:17

You can create a floating div on the current page, with a form containing a password field.

alternative: let the bookmarlet point to a particular web page. Get the password from the user on that page, and continue.

This solution does not use javascript at all, as you may have noticed. If you really insist on using javascript, you will have to create a new window using javascript (window.open), add form and input elements to it, and set the form's submit value to your web app backend.

you can of course, display a dialog box on the current page, but that will be pretty irritating to the user. Be warned.

jrh

there isn't one - try looking into Thickbox on a modal setting like this:

<a href="iframeModal.html?placeValuesBeforeTB_=savedValues&TB_iframe=true&height=200&width=300&modal=true" title="add a caption to title attribute / or leave blank" class="thickbox">Open iFrame Modal</a>

The easy, fast answer: No, there are no cross browser method like window.prompt() that masks the user input. There are however some proprietary stuff you could look into. In MSIE you got window.createPopup(), window.showModalDialog() and window.showModelessDialog(). However I don´t reccomend using this approach =P

What would happen if you used http authentication for your destination? Would the UA prompt the user with a un/pw?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!