Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How much modal is isc.ask?

    Code:
    userAnswer = false;
    isc.ask(test', 'if (value) userAnswer = true');
    alert(userAnswer);
    This code will show false for userAnswer right away without waiting for me to click on yes. How do I make ask method modal?

    Thanks

    #2
    Right - that's because isc.ask() is asynchronous: it shows a dialog and when the user clicks Yes/No, that's when the callback specified in the second argument is actually fired. In terms of execution, however, as soon as the line that reads isc.ask() is executed, the JS interpreter continues executing code and pops up the alert.

    In other words, isc.ask() doesn't stop the JS interpreter, it just shows a dialog. Makes sense?

    Comment

    Working...
    X