1
我开始学习jquery mobile,我跟着这个http://dev.jtsage.com/jQM-SimpleDialog/demos/string.html。当我点击按钮时没有任何反应。我写的代码是:jquery手机对话框
<link rel= "stylesheet" href= "http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css" />
<script src= "http://code.jquery.com/jquery-1.5.2.min.js"></script>
<script src= "http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>
<script type="text/javascript">
$(document).delegate('#simplestring', 'click', function() {
$(this).simpledialog({
'mode' : 'string',
'prompt' : 'What do you say?',
'buttons' : {
'OK': {
click: function() {
$('#dialogoutput').text($('#dialoglink').attr('data-string'));
}
},
'Cancel': {
click: function() { },
icon: "delete",
theme: "c"
}
}
})
})
</script>
然后身体内我写道:
<p>You have entered: <span id="dialogoutput"></span></p>
<a href="#" id="dialoglink" data-role="button">Open Dialog</a>
可否请你指出我的错误?也许在头上?我必须学习jquery mobile,因为我在javascript中编写了一个对话框,它不会显示在我的Web应用程序中。我读到JQM中的SimpleDialog旨在替代javascript对话框()。
http://jsbeautifier.org/ – Daniel 2012-01-03 04:29:10