JQuery dialog() Error

半腔热情 提交于 2019-12-12 04:30:35

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!