0
我想知道如何使用页面和多个对话框加载外部页面。加载包含多个数据部分的外部文件
//I am in index.htm, a multi-page file which will send a big object to anotherpage.htm
$.mobile.changePage(anotherPage.htm, {type:"post",data:formData})
这将使帖子很好,并通过formData。但是,anotherPage.htm中的对话框不可用。如果我直接访问anotherPage.htm,则页面按预期运行。按照预期,jQM只能在另一个页面中找到的第一页加载。
//anotherpage.htm
<div data-role="page" id="mypage">
<p id="something">Some thing</p>
<script>
//bind to the pageinit event to fire the email handling.
$("#something").live("click", function() {
$.mobile.changePage('#successDialog',{ transition: "pop", role: "dialog", reverse: false });
});
</script>
</div>
<div data-role="dialog" id="successDialog" >
<p>Success!</p>
</div>
<div data-role="dialog" id="failureDialog" >
<p>Failure!</p>
<a id="dialogClose" href="#" data-rel="back" data-role="button">Close</a>
</div>
我认为当我尝试传统提交而不是更改页面时,我处于正确的轨道上。我没有做的是将数据对象附加到正确提交,如此处所示。 http://stackoverflow.com/questions/2530635/jquery-add-additional-parameters-on-submit-not-ajax – 2012-02-20 16:50:40