向 JQM 列表视图添加动态选项在page1. 添加后,listview被刷新:
$('#list').listview('refresh');
选项链接到page2。在page2我有pagebeforeshow事件:
$('#page2').live('pagebeforeshow', function (e, data) {
alert(data.prevPage.attr('id'));
});
data.prevPage.attr('id')is undefined when the option selected was the one added dynamically. 但对于另一种选择,完全没有问题。
page1为什么在列表视图中选择动态添加的选项时无法获取id?