montrealmike montrealmike - 5 months ago 41
Javascript Question

Javascript modal to replace prompt?

What is the best way to replace

var value = prompt("Enter a URL", "");

by a javascript modal (preferably pure javascript, if not possible then jquery)



You will need to change theway you call it, so it now follows event-driven programming style like that:

function prompt(question, callback) {
    // here build a modal/form and after form submit:

And then use it like that:

prompt('Enter a URL:', function(result){
    // do something with the result: