0

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.

it's show this message errors and stop pop up any more

How to resolve it.

Anujith
  • 9,370
  • 6
  • 33
  • 48
koe
  • 736
  • 1
  • 12
  • 33

1 Answers1

0

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'

Community
  • 1
  • 1
Choco
  • 1,054
  • 1
  • 7
  • 20