简体   繁体   中英

JQuery pop up dialog can not open

I am using jqueryui/1.9.2/jquery-ui.min.js for pop up dialog. This is my code

$("#button_id").on("click", function(){
    $("#dialog").dialog("open");
})

When i click on button in first time it's pup up dialog as normal but after dialog close. Than I click on it again, It's show message like this

Error: cannot call methods on dialog prior to initialization; attempted to call method 'open'  like in image.

它显示此消息错误并停止弹出

How to resolve it.

Please Initialze it before using

$("#dialog").dialog({
        autoOpen: false
    })

Please have a look at this link

jQuery UI - Error: cannot call methods on dialog prior to initialization; attempted to call method 'open'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM