我正在使用下面的代碼刷新頁面。但是,在將button
移動到header
時,它不再適用。所以button
需要在content
部分才能工作。我猜它是與.mobile.changePage
刷新頁面按鈕點擊jquery mobile
function refreshPage() {
$.mobile.changePage(
window.location.href,
{
allowSamePageTransition : true,
transition : 'none',
showLoadMsg : false,
reloadPage : true
}
);
}
$(window).load(function(){
$('#refresh').on('click', function (e) {
refreshPage();
});
})
我使用下面的代碼調用按鈕:
<div data-role="header">
<button id="refresh" data-icon="refresh">Refresh</button>
</div>
你所有的頁面都在一個html文件中(很多data-role =「page」divs,或者你是鏈接到多個html文件嗎? – ezanker
這只是一個文件 – Andreas