I am trying to convert **alert()** to **sweetAlert()** in this portion of code:

```
if (ttlpg > 0) {

    if (resultSaveParameters == true && resultSaveImage == true) {
        //more code
    } else {
        $('#loadingdivmain').hide('fast');
        alert("Upload Error.");
    }

} else {
    //this should alert
    sweetAlert('Sorry', 'No image(s) to save', 'error');
}

```

I am using **sweetAlert()** in the same js file on other parts of the coding, and it is working fine.

[Here](https://limonte.github.io/sweetalert2/) is the source I am using.