Showing Cool Modal Pop Up Dialog Boxes with Javascript

As a web developer, your task will frequently require you to show different kinds of pop up modal dialog boxes to the end user. The pop ups could be about showing an error, or a success message or could even be about asking the user to submit some kind of form as an input.

Imagine being able to go from:

Basic Alert

Basic Alert

to here:

Sweet Alert

Sweet Alert

in a matter of minutes.

Or if you are simply looking to ask a user to confirm something as below:

Confirm Pop Up

Confirm Pop Up

And even ask user’s to enter for inputs that you can submit to the server through some ajax call:

Aja Submit Pop up

Aja Submit Pop up

You can get all these features and more like the message with auto timer, pop up with custom CSS, images and much much more without having to write much code from scratch.

How?

This plugin is called SweetAlert using which you can get all of these features.

Actually, there are two versions of this plugin: SweetAlert and SweetAlert2 maintained by two separate guys and you choose either one for your project they are almost identical and really amazing!

SweetAlert2 was developed by someone because SweetAlert was not being updated for a while. However, the original is also now back on the track so you can pick either.

Sweer Alert2

Sweer Alert2

READ  Ruby Vs. Python as Programming Language