You can use JQuery UI Dialog to display a DIV as a modal dialog.
See http://docs.jquery.com/UI/Dialog/dialog#options
However to support a truely synchronous dialog (a blocking function call) you would need some help from the browser. Not all browsers support it. IE has done for many years and recently mozilla have add showModalDialog to Firefox.
Have you considered using a closure to provide continuation on callback?
Example
function dosomethingwhichneedsprompt()
{
var a = "stuff";
var o = {}
//other code
displayPrompt("PleaseInputStuff",o) //o modified by prompt would like this to block
//continue to use data on o and the variable a after prompt dismissed.
}
Since displayPrompt can't realiable block on all browsers, frameworks will use callbacks instead:-
function doSomethingWhichNeedsPrompt(fnContinue)
{
var a = "stuff";
var o = {}
//other code
displayPrompt("PleaseInputStuff",o, fnCallback)
function fnCallback() {
//continue to use data on o and the variable a after prompt dismissed.
if (fnContinue) fnContinue();
}
}
Of course anything calling doSomethingWhichNeedsPrompt
would also need to be aware of its async nature and there for doSomethingWhichNeedsPrompt
may need to take function parameter which it calls after its done all its work.