Hacker News new | past | comments | ask | show | jobs | submit login

Sweet Alert came up before and people made this same pedantic and unimaginative addition -- I honestly think this comment serves only to let everyone know that the commenter understands the Javascript execution model. That the thread stops while a native alert is shown is not quite a bug, but I'd argue not a desired feature either.

But given that window.alert has (apparently) two functions:

- Display a message to a user

- Block javascipt execution until a button is pressed

This is a great replacement for those who are using it for #1, which in my experience, is probably >99% of its usage in the wild. If you're using window.alert to, say, synchronize the beginning of an event with a user click this probably will work just fine too. If you need the world to stop until a button is pressed, I'd sooner guess that your application is written poorly.




> Sweet Alert came up before and people made this same pedantic and unimaginative addition

Its presented as a replacement for alert so pointing out that it's not a drop-in replacement seems relevant to me at least. Even if most alert usages can easily be replaced by this (somewhat dubious depending on your definition of "easily"), additional work will still need to be done for many (most?) of them.

Also being able to add a "blocking" call in JavaScript would be a _big deal_, so noting that this does not do so seems like something worth mentioning.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: