Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > Dialog API


Scroll Prev Next More

SweetAlert2 is yet another replacement for Javascript alert() function. You can use it in any Javascript events. You can find more examples in SweetAlert2 documentation.


Example 1


Just a simple popup message.'Any fool can use a computer');


Example 2


A title with a text under.
'The Internet?',
'That thing is still around?',


Example 3


A modal with a title, an error icon, a text, and a footer{
 icon: 'error',
 title: 'Oops...',
 text: 'Something went wrong!',
 footer: '<a href="">Why do I have this issue?</a>'


Example 4


A modal window with a long content inside:{
 imageUrl: ''
 imageHeight: 1500,
 imageAlt: 'A tall image'




See also:

AJAX helper object -> submit()

Tri-part events: Asynchronous tasks

Dialog API