With the impending removal of the showModalDialog API from various browsers, our company like many others who provide large scale enterprise web applica
You can avoid using callback functions by using my showModalDialog polyfill, which pauses execution of subsequent statements until the modal is closed. It does so by using generators, promises and the yield keyword. It works in the newest Opera and Google Chrome.