jquery - JavaScript runtime error: cannot call methods on dialog prior to initialization; attempted to call method 'close'" -


error running below code block: "0x800a139e - javascript runtime error: cannot call methods on dialog prior initialization; attempted call method 'close'". failing @ statement: $(this).dialog("close");

function deletereport(reporttitle, reportid) {     reportidtodelete = reportid;      var buttons = [         '<button id="btnyes" class="modalbtn" onclick="confirmdeletereport();">yes</button>',         '<button id="btnno" class="modalbtn" onclick="$.modal.close();">no</button>'     ];      showmessage('are sure want delete report:' + reporttitle + '?<br>this action cannot undone.', '', buttons); }     function confirmdeletereport() {     $.ajax({         url: "/report/deletereport",         data: { reportid: reportidtodelete },         type: 'get',         success: function (data) {             if (data.coderesult == 1) {                 $(this).dialog("close");                 window.location.reload(true);             }             else {                 showmessage(data["message"], "");             }         },         error: function (request, status, error) {             showmessage("error while proccessing ..", "error, report not deleted");         }     }); } 


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -