Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you literally mean the <a href="https://developer.mozilla.org/En/DOM:window.prompt" rel="nofollow noreferrer"><code>prompt</code></a> function, you can't. What you can do instead is pop up a <code>div</code> or similar above the main content of your page (using absolute positioning and a <code>z-index</code> value) and put the password box in there.</p> <p>More in the various answers to these questions:</p> <ul> <li><a href="https://stackoverflow.com/questions/4407286/how-to-have-a-jquery-popup-window-by-using-only-jquery-without-other-extra-js">How to have a JQUERY POPUP window by using only JQUERY (without other extra JS)</a></li> <li><a href="https://stackoverflow.com/questions/3958057/making-a-javascript-yes-no-confirmation-box">Making a Javascript Yes/No Confirmation Box?</a></li> </ul> <p>There are a variety of libraries you can use that will do the hard work for you (not that it's <em>that</em> hard, but still). If you're already using a library like <a href="http://jquery.com" rel="nofollow noreferrer">jQuery</a>, <a href="http://prototypejs.org" rel="nofollow noreferrer">Prototype</a>, <a href="http://developer.yahoo.com/yui/" rel="nofollow noreferrer">YUI</a>, <a href="http://code.google.com/closure/library" rel="nofollow noreferrer">Closure</a>, or <a href="http://en.wikipedia.org/wiki/List_of_JavaScript_libraries" rel="nofollow noreferrer">any of several others</a>, you may find that there's a plug-in designed for use with that library (<a href="http://jqueryui.com" rel="nofollow noreferrer">jQuery UI</a> for jQuery, for instance). If not, there are plenty of stand-alone implementations. Look for "light box" or "lightweight window" or "JavaScript dialog box", etc.</p> <p>Note that any of these will require a bit of a change to the logic of your code, since <code>prompt</code> brings the browser and your script to a screeching halt until the prompt is dismissed by the user, whereas this mechanism of flying an element over the top of the content is, by its nature, asynchronous.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload