The CreatorCon Call for Content is officially open! Get started here.

SweetAlert - a beautiful replacement for javascript's "alert"

Matt Saxton - G
Kilo Guru

 

SweetAlerts2 is out. 

 

SweetAlerts2

 

Hi Dev's,

 

Last night i was working on an application that needed some input. So i used SweetAlerts on the custom UI page and it turned out really nice looking, and i thought i could use globally!.

 

ServiceNow Share - SweetAlert

 

Once you install you can do any of the tests via the console

 

parent.swal({     title: "Are you sure?",     text: "You will not be able to recover this imaginary file!",     type: "warning",     showCancelButton: true,     confirmButtonColor: "#DD6B55",     confirmButtonText: "Yes, delete it!",     closeOnConfirm: false }, function(){     swal("Deleted!", "Your imaginary file has been deleted.", "success"); });

 

Make sure that you use "parent.swal()"

 

Here's more examples listed here SweetAlert

 

Screenshot's below.

 

2015-10-01 13_48_38-ServiceNow.png

 

2015-10-01 13_37_06-ServiceNow.png

44 REPLIES 44

mike_donathan
Kilo Guru

Matt,



I don't know whether to praise you for the random bad 90's musical reference, or chastise you for the random bad 90's musical reference in the first set of screenshots....



BUT



I do like the SweetAlerts!


It could only have been better if the SweetAlert window said "more beautiful" as the subtext.



Oh, yeah.


Jim Coyne
Kilo Patron

Very nice indeed!!!   Thanks for sharing.


valeriemorris
Mega Expert

This is fantastic and is just what I was looking to implement. Thank you for making my life so much easier!