How to use sweetAlert without adding the sweetAlert file to extension

Sweet Alert is used for the showing alters in model, we can use the jQuery CDN to show the alert messages instead of pasting the whole file in the extension by using this solution.

use the CDN link in $.getScript(url) method on initialize of the view.

$.getScript("https://cdnjs.cloudflare.com/ajax/libs/sweetalert/2.1.2/sweetalert.min.js");

We are not required to add file we can access Swal without importing it, it only works on the front end not on server side

Leave a comment

Your email address will not be published. Required fields are marked *