I want to create a custom confirmation box on my site.
- Can an event handler be bound inside of an anonymous function.
- Will javascript wait on a return value or return null/false after a timetout/pause in execution.
- Is a confirmation box possible with deferred objects? I'm having a really hard time putting together how deferred objects work and how to implement them. Would the following work in theory?
HTML
<div id='box'>
<button id='confirm'></button>
</div>
<button id='startConfirmation'></div>
javascript (jquery)
$('#startConfirmation').click(function()
{
if(buttonClicked())
{
//do stuff
}
});
function buttonClicked()
{
return $('#confirm').click(function()
{
return true;
});
}