當我按一下按鈕我使用下面的代碼爲對話框的功能:爲什麼使用jQuery UI獲得「類型錯誤對話框不是函數」?
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");
}
然而,當我檢查一下在Firebug它顯示這個錯誤在控制檯:
TypeError: $(...).dialog is not a function [Break On This Error]
modal: true
編輯:文檔中還有另一個對話框可以正常運行。當我註釋掉那一個時,這個對話框就開始工作了。 如何更改我的代碼,以便他們可以在同一頁面中一起工作?
你已經包括jQuery的ui.js文件 –
例如:'' –
包含Jquery和Jquery UI,我有另一個打開的對話框,但這不是。我應該把這個文件準備好嗎? – HardCode