I've been doing a lot of research on this. I ended up borrowing from the JS libraries out there and rolling my own version for alert, confirm and prompt.
The main issue is that these type of messages do not pause execution like the windows versions do. I tried break and throw but neither worked. Usually during prompt the whole point is to wait for user input. Since there is no code pause then the workflow continues without waiting. In some cases I could handle it by putting the code in the callback. But that doesn't always fit what I need.
Unfortunately the IE implementation is really ugly. Chrome is nicer but can't force users to use Chrome.
Has anyone figured out a way to make these really behave like the windows versions.