David Barker

SweetAlert - A beautiful replacement for JavaScript's alert()

Add a comment

Replies

Best
Ryan Detzel
Why not just override the existing alert() method so it just works? Try to make that work and I will use this for every project! http://stackoverflow.com/questio...
Willem Spruijt
@ryandetzel You could, but then you are forced to use this alert everywhere in your app, while sometimes you want to use it only at specific places.
Kilian Valkhof
@ryandetzel You could add window.alert = sweetAlert; to your javascript and it will already do so!
Willem Spruijt
Looks great, but would love to see keyboard shortcuts (at least enter).
Phil Freo
Keyboard shortcuts! A lot of the JavaScript UI widgets that are a replacement for native/browser controls _look_ nicer, but that doesn't mean the overall UX is better. Keyboard shortcuts, auto-focus, etc. are crucial for things like alert/confirm/prompt. For completeness, would be nice to see matching confirm/prompt as well. And I agree - there should be an option for clobbering/overriding the original alert function.
Chad Fullerton
Simple. Effective. Nice job @dvyio
Kim Schulz
Very nice and simple.
Aakil
Looks good! Does this block execution like `alert()` does?
Phil Freo
@aakilfernandes I don't think that's possible (at least not in a way that Chrome wouldn't give you some sort of slow js performance warning)
Brock
@t4t5 Nice job! This looks great for the amount of time you spent on it
Troy Osinoff
this IS much sweeter. Great design