This question already has an answer here:
- jquery ui Dialog: cannot call methods on dialog prior to initialization 9 answers
[Solved] I write this script. Unfortunately, jQuery console throw:
Error: cannot call methods on dialog prior to initialization; attempted to call method 'open'
I use jQuery 1.10.2 and jQuery UI 1.10.4.
$(function() {
$("#player").on('click', 'img', function() {
var zadanie = $( "input[name^='act']:checked:enabled" ).val();
switch(zadanie){
case '1':
alert('fajowo jesteś uczciwy');
break;
case '2':
$( "#dialog" ).dialog( "open" );
break;
}
});
});
Dialog in HTML:
<div id="dialog" title="Wybór karty, która zostanie położona oficjalnie">
<p>Fajowy tekst.</p>
</div>