问题
I get the error message shown below when I click the button: ($'#billing_button_addTime')
billingController.dialogAddTime.dialog is not a function
billingController is created in $(document).ready
.
function BillingController() {
}
BillingController.prototype.dialogAddTime = $(document.createElement('div'));
BillingController.prototype.loadBillingContent = function () {
//Load the main content
$("#content_area").load('/Content/HTML/billing.html', null, mainController.attachScrollBarsToCPOTable);
//Pre-Load the Add Time Dialog
$(billingController.dialogAddTime).load('/Content/HTML/billing_dialog_addTime.html', null, billingController.bindButtonAddTimeToHandler );
}
BillingController.prototype.bindButtonAddTimeToHandler = function () {
$('#billing_button_addTime').bind('click', billingController.buttonHanderAddTime);
}
BillingController.prototype.buttonHanderAddTime = function () {
billingController.dialogAddTime.dialog({ modal: true });
}
回答1:
BillingController.prototype.dialogAddTime = $('');
This does not look right to me.... You may have to do is to define the div in the html
<div id="billingDialog"></div>
And then in script use as follows:
BillingController.prototype.dialogAddTime = $('#billingDialog');
Hari Gangadharan
回答2:
I boneheadedly forgot to include the JQuery UI script. Thanks everyone.
来源:https://stackoverflow.com/questions/5426984/jquery-dialog-error