Home » Javascript » exception= TypeError: $(…).dialog is not a function

exception= TypeError: $(…).dialog is not a function

Posted by: admin October 29, 2018 Leave a comment

Questions:

I have the following inside my javascript:-

 $("#CustomMessage").after("<div id='MyDialogID'  title='My Dialog Title'></div><br/><br/><a id='dialogtrigger' href='#' >*Items </a>")
 $("#MyDialogID").dialog({
    autoOpen: false,
    position: 'center' ,
    title: 'Quick Order List',
    draggable: false,
    width : 300,
    height : 40, 
    resizable : false,
    modal : true,
});

$("#dialogtrigger").click( function() {
    $("#MyDialogID").load('/Management/Items.aspx', function() {
        $("#MyDialogID").dialog("open");
    });
})

but this is raising the following error:-

exception= TypeError: $(...).dialog is not a function
Answers: