3 ms·
> It overrides alert() but doesn't - and can't - duplicate its blocking behavior. If you really wanted to, I think you could set up an endpoint on your server
by aidanhs 12y ago
> It overrides alert() but doesn't - and can't - duplicate its blocking behavior.
If you really wanted to, I think you could set up an endpoint on your server to be long polled with synchronous XHR in a while loop, while you set up the popup in an iframe. When the popup is clicked, you send a notification to the server so the next synchronous request returns 200 and you dispose of the iframe.
On searching, I discover someone else has had this crazy idea already - http://stackoverflow.com/questions/16934667/what-methods-are-blocking-in-javascript http://stackoverflow.com/questions/16934667/what-methods-are...
- Stratoscope 12y agoI like that kind of insane creativity! I'm surprised that the SO poster got the synchronous XHR approach to work. When I did some tests with Chromium last year they seemed to show that an iframe runs in the same thread as its parent window. I wasn't testing XHR though, just animation. So if you ever do try this out, I would be interested to hear the results. Thanks!
- MasterScrat 12y agoThis reminds me of this SO answer. I never understood what the guy was trying to do but people seem to be happy with it?! http://stackoverflow.com/a/16758230/318557 http://stackoverflow.com/a/16758230/318557