Why am I getting "Type error dialog is not a function" using jQuery UI?

When I click the button, I use the following code for the function for the dialog:

function Confirmation(msg1){ if ($('#exportSales').length == 0) { $(document.body).append('<div id="exportSales">'+msg1+'</div>'); } else { $('#exportSales').html(msg1); } $("#exportSales").dialog({ autoOpen: false, show: "blind", hide: "explode", height: 450, width: 1000, modal: true }); $( "#exportSales" ).dialog("open"); } 

However, when I test this in FireBug, it shows this error in the console:

 TypeError: $(...).dialog is not a function [Break On This Error] modal: true 

EDIT . There is another dialog box in the document that works great. when I comment that then this dialogue opens. How do I change the code so that they can work together on the same page?

+7
source share
2 answers

This happened due to two Jquery incoming files. So watch out for the source code. This can help you get rid of this stupid mistake.

+17
source

Also check if Jquery Ui Script is loaded correctly or not

+1
source

All Articles