有沒有辦法從jqueryMobile對話框中獲取返回值?這裏是jQueryMobile文檔的簡單代碼,但不能完全工作。如何從jQueryMobile對話框中獲取返回值?
指數
<link rel="stylesheet" href="jquery.mobile-1.0a4.1.css" />
<script src="jquery-1.5.2.min.js"></script>
<script src="jquery.mobile-1.0a4.1.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.delete-dialog-yes').click(function() {
alert("delete-dialog-yes");
});
$('.delete-dialog-no').click(function() {
alert("delete-dialog-no");
});
});
</script>
</head>
<body>
<div data-role="page" id="my-page">
<div data-role="content">
<a href="delete-dialog.cfm" data-role="button" data-rel="dialog" data-transition="pop">Show Dialog</a>
</div>
</div>
對話框
<link rel="stylesheet" href="jquery.mobile-1.0a4.1.css" />
<script src="jquery-1.5.2.min.js"></script>
<script src="jquery.mobile-1.0a4.1.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.delete-dialog-yes').click(function() {
alert("delete-dialog-yes");
});
$('.delete-dialog-no').click(function() {
alert("delete-dialog-no");
});
});
</script>
<title>Dialog</title>
</head>
<body>
<div data-role="page" id="delete_dialog" data-theme="b">
<div data-role="content" data-theme="b">
<h1>Delete Item?</h1>
<p>Are you sure you want to delete this item?</p>
<a href="#" class="delete-dialog-yes" data-role="button" data-theme="b">Yes</a>
<a href="#" class="delete-dialog-no" data-role="button" data-theme="b">No</a>
</div>
</div>