craftpip / jquery-confirm

A multipurpose plugin for alert, confirm & dialog, with extended features.
http://craftpip.github.io/jquery-confirm/
MIT License
1.87k stars 508 forks source link

Uncaught TypeError: $.confirm is not a function - jQuery Version #501

Open gurusaini opened 4 years ago

gurusaini commented 4 years ago

I am using jquery confirm https://craftpip.github.io/jquery-confirm/

I am getting Uncaught TypeError: $.confirm is not a function - when I directly put the below code

<script type="text/javascript" src="Scripts/jquery-confirm.js"></script>
$(document).ready(function () {
       // (function ($) {

$.confirm({
                    title: 'A secure action',
                    content: 'Are you sure to delete the selected record(s)',
                    icon: 'fa fa-question-circle',
                    animation: 'scale',
                    closeAnimation: 'scale',
                    opacity: 0.5,
                    buttons: {
                        'confirm': {
                            text: 'Proceed',
                            btnClass: 'btn-blue',
                            action: function () {
                                $.confirm({
                                    title: 'This maybe critical',
                                    content: 'Critical actions can have multiple confirmations like this one.',
                                    icon: 'fa fa-warning',
                                    animation: 'scale',
                                    closeAnimation: 'zoom',
                                    buttons: {
                                        confirm: {
                                            text: 'Yes, sure!',
                                            btnClass: 'btn-orange',
                                            action: function () {
                                                $.alert('A very critical action triggered!');
                                            }
                                        },
                                        cancel: function () {
                                            $.alert('you clicked on cancel');
                                        }
                                    }
                                });
                            }
                        },
                        cancel: function () {
                            $.alert('you clicked on cancel');
                        },
                        moreButtons: {
                            text: 'something else',
                            action: function () {
                                $.alert('you clicked on something else');
                            }
                        },
                    }
                });
 //})(jQuery);
        });

Notification:355 Uncaught TypeError: $.confirm is not a function at HTMLAnchorElement. (Notification:3525) at HTMLAnchorElement.dispatch (jquery-3.3.1.js:5183) at HTMLAnchorElement.elemData.handle (jquery-3.3.1.js:4991)

Dev25-00 commented 4 years ago

have the same issue, dont understand why, i'm importing by cdn and installing the module in project and it doesn't work at all, if did u figure out how to fix this let me know it would help more then one ! Thx!

sudarakas commented 4 years ago

Please try CDN, or check page source to confirm your links are properly linked to the local file.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js"></script>

abr-rahman commented 1 year ago

Thank you, for information