i have in jquery mobile when i passing parameter using change page.
$("#mytest-listview div.mytest-title a").live('click', function (event,data) {
var cid = $(this).attr('id');
console.log(cid);
$.mobile.changePage('../mytestdetail/',{ type: "get", data: {"id":cid} , reloadPage:false, changeHash:true });
$('#pgMyTestDetail').live('pageshow', function(){
var id = $.urlParam('id');
doLoadMyTest(id);
});
$.urlParam = function(name){
var results = new RegExp('[\\?&]' + name + '=([^&#]*)').exec(window.location.href);
return results[1] || 0;
}
event.preventDefault();
});
当我mytest的标题点击它传递的mytest的ID,以URL,然后我得到的id值并显示mytest的所有细节。这里是url/test/testdetail /?id = 26,但是当我得到测试详细信息页面时,我点击了ctrl + R它刷新了页面,但没有显示测试细节。有什么问题?jQuery Mobile的参数传递使用变化页
如果你仍然有这个麻烦,我[插件](https://github.com/CameronAskew/jquery.mobile.paramsHandler)可能会帮助 –