TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Sweet Alert for Bootstrap – Blends nicely with any Bootstrap based project

95 pointsby lipisover 10 years ago

19 comments

akvladover 10 years ago
I agree this does look sweet, however this is not a replacement for alert. window.alert() is a blocking function, it prevents further code to be interpreted while the alert or prompt is open.
评论 #8488058 未加载
评论 #8488054 未加载
mandeepjover 10 years ago
Please have "Esc" key cancel\close the dialog box. It is the inherent behavior please do not break it.
评论 #8488031 未加载
mk4pover 10 years ago
I met the most interesting guy once. He was a professor at Columbia and a consultant for Wall Street, helping design UIs for traders.<p>He explained how we process and prioritize visual cues -- how, if an element expands equally to the left AND right of our field of vision, it gets highest priority because it resembles an object heading toward our face.<p>For that reason, he avoided this design for everything except the highest-priority events.<p>Not crapping on your library -- it looks really nice :) But in general, I think it&#x27;s worth considering if it&#x27;s necessary to demand users&#x27; attention all over the place. I think information overload isn&#x27;t solely in the content we consume but how it&#x27;s presented.
warbleover 10 years ago
I&#x27;ve been seeing a few of these libs pop up on HN lately. Apparently there&#x27;s some sort of need here that people are trying to fill, it&#x27;s just not clear to me what it is.<p>There are legitamite suggestions that blocking UI paradigms are bad, but they&#x27;re very useful at times. I&#x27;m not arguing either, as I think each has their place (although I tend to avoid blocking personally if I can)<p>My real question is why now?
评论 #8488493 未加载
execatover 10 years ago
The way the alert comes in is very annoying.<p>The homepage doesn&#x27;t tell me if I can customize the animation.
aidosover 10 years ago
It would be nice if it was possible to select &#x2F; copy the message in the box. Sometimes you get a message that you want to copy &#x2F; paste to someone (email, chat, etc) and it&#x27;s annoying to have to type it out again.
JoshTriplettover 10 years ago
Nice style, and I appreciate that I can hit Esc to dismiss most of the dialogs, though unfortunately not all of them.<p>As another commenter said, I do wish that clicking outside of it had the same effect, but that may have more to do with what sites typically abuse these kinds of boxes for (&quot;Alert! Sign up to our...&quot; (no go away)).<p>One issue I noticed: there&#x27;s a race condition in the second-to-last example (&#x27;...and by passing a parameter, you can execute something else for &quot;Cancel&quot;.&#x27;), where if you hit escape quickly enough as the box gets launched, the cancellation handler does not run.
评论 #8487989 未加载
marknutterover 10 years ago
Isn&#x27;t this just a modal?
评论 #8488175 未加载
评论 #8488074 未加载
decentralityover 10 years ago
This really needs to be added to <a href="http://jsdelivr.com" rel="nofollow">http:&#x2F;&#x2F;jsdelivr.com</a> so we can package it in with existing CDN calls.<p>There seem to be very sparse examples of how to deploy the library properly, only to implement it.<p>Visually great. Cool how there&#x27;s the ability to catch responses and work in the same modal further.
评论 #8488446 未加载
yournemesisover 10 years ago
I still don&#x27;t get why javascript developers put so much effort into a library and don&#x27;t provide tests for it.
评论 #8488015 未加载
FreakyTover 10 years ago
I usually find alert libraries boring, but these are really cool -- I particularly enjoy the icon drawing animations.
jcagalawanover 10 years ago
Slight clipping issue <a href="http://imgur.com/TKAk41f" rel="nofollow">http:&#x2F;&#x2F;imgur.com&#x2F;TKAk41f</a>
评论 #8488079 未加载
amateraover 10 years ago
swal(&quot;Here&#x27;s a message!&quot;) !== alert(&quot;Here&#x27;s a message!&quot;)<p>Am i wrong or is a replacement not something which replace the original function? (beside the blocking aspect of an alert). Looks beautiful anyway :)
j_sykover 10 years ago
Looks cool. I&#x27;d like to see [esc] to close dialog. And is it a safe default to have [enter] perform the action especially on warning and danger? (just a thought)
coreymgilmoreover 10 years ago
This is an eerily similar project to something posted a few weeks ago here. Most notably, the exact same &quot;success&quot; animation.<p><a href="https://news.ycombinator.com/item?id=8420902" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8420902</a><p><a href="https://github.com/t4t5/sweetalert" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;t4t5&#x2F;sweetalert</a>
评论 #8488085 未加载
评论 #8488090 未加载
emodendroketover 10 years ago
Why would I use this instead of the built-in modals? Seems like it does the same thing.
评论 #8488188 未加载
NDizzleover 10 years ago
Just in time for Halloween! Scary, jarring alerts.
csbrooksover 10 years ago
Very slick!
iand675over 10 years ago
The icon animations are really slick!