Sweet Alerts – Replacement of Javascript Alert Function

A beautiful replacement for  javascript’s “ALERT” is Sweet Alert( a.k.a Swal)

Sweet Alert is a responsive alert which automatically centers itself

on the page and looks great no matter if you’re using a desktop computer, mobile or tablet.

It’s even highly customizeable.

You just need to include 1 JS file and 1 CSS file for Sweet Alert i.e.

<script src="./js/sweet-alert.min.js"></script>
<link rel="stylesheet" href="./css/sweet-alert.css">

To call the sweetAlert-function you just need to do following:
   title: "Error!",
   text: "Here's my error message!",
   type: "error",
   confirmButtonText: "Cool" 

It is highly customize-able to get rid out of alert().

For downloading needed JS and CSS and documentation you can visit:
Sweet Alert Website

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s