[英]jquery mobile dialogs, passing values between pages
移动页面通信(在页面之间传递数据)可以通过以下方式完成:
下面是使用Jquery.data()的示例。
http://dl.dropbox.com/u/49735179/dialog-data-transfer.html 。
希望这可以对您有所帮助:)
我还没有深入研究jQuery mobile,但是快速浏览一下,它看起来与jQuery UI的弹出对话框没有太大不同。 在这种情况下,您可以尝试在对话框启动时将数据收集器绑定到按钮。
$('#testdiv').dialog({ //initiate dialog
someoption: "test", //fake stuff for example
otheroption: "foo", // ---
buttons: { //define buttons for dialog
"Ok": function() { //define "ok" button
var userInput = $('#inputInDialog').val(); //get value of the textbox in the dialog
$('#domOnMainPage').text(userInput); //write that value to main page
}
}
})
同样,我还没有涉足移动领域,但我想这可能与您要寻找的非常接近。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.