SweetAlert - a beautiful replacement for javascript's "alert"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-01-2015 10:50 AM
SweetAlerts2 is out.
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!.
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.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2016 11:54 AM
Hey Matt.
2 things:
- I can get the script to run using Fuji, however, when I try to run it in Geneva, nothing happens. Here is the error I'm getting in the UI script:
- How can i get this alert to show up on a group of user's SN instances instead of just the client calling the script? We have an operations center w/ 10 ppl or so. They'd like to get an alert on their screen when a new critical ticket comes in
Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-04-2016 01:44 PM
Hey Matt,
I saw if there is a new version of SweetAlert on internet: https://limonte.github.io/sweetalert2/#select-box
Can you create the xml file to install on the ServiceNow?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2017 10:29 AM
Hello Everyone
I have checked this feature and looks awesome. I have small question in using this. Can we also pass a URL link using this swal(). I know URL's/links are not supported by alert() method. But just curious if this is possible. Below is what I'm looking for.
I would like to see the text as well as the link(Click here). I know this is not usually supported by alerrt(). Any thoughts on this is greatly appreciated.
Regards!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2017 10:36 AM
Hello Nitin,
Yes, you can I think.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-31-2017 02:03 PM
Hello Surya
Thanks for responding. I was able to use the swal(), but unfortunately the link is not populated on the alert, I can see the text message, confirm button but the url is not displayed. I have just used the code which was there in the above link you have given. Please find my code I'm using and the output I see
Catalog Client Script:
function onChange(control, oldValue, newValue, isLoading) {
//debugger;
//alert('testing');
if (isLoading || newValue == '') {
return;
}
var x = g_form.getValue('computer');
if(x == 'mac')
{
/*alert("This is test <a href='www.google.com'>Google</a>");
var dialog = new GlideDialogWindow('alertpopup');
dialog.setTitle("Please Check Macbook instructions");
dialog.setSize(500,200);
dialog.render();*/
swal({
title:'We are pleased to offer Macs with "best effort" support. For more information before making the switch to a mac, please click here to ensure you understand the support that will be available to you',
html:'<a href="//google.com" target = "_blank">Click here</a>',
confirmButtonText: 'Ok',
});
}
}
Below is the output I see:
LINK IS NOT DISPLAYED IN THE ABOVE ALERT. Please let me know if I need to tweak something in the code?
Regards!