我正在尝试创建一个对话框Jquery mobile.我试图在这个SO问题中提到已接受的答案,但它对我不起作用.
这是我的代码:
<div data-role="page" id="first">
<!-- Code -->
<div id = "dialog" data-rel="dialog">
<div id = "errorText"></div>
<button id = "closeDialog">OK</button>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这里是JS(在函数内部):
//Nothing checked. Cannot continue. Add error message to div
$('#errorText').html("You must check the checkbox next to \"I Agree\" to continue");
//Open Dialog
$('#dialog').dialog();
Run Code Online (Sandbox Code Playgroud)
当达到创建对话框的代码时,没有任何反应.建议?