简体   繁体   中英

When clicking a button go to next page and refresh the previous one Jquery Mobile

I got a Jquery Mobile app, when I click a button (ordernumber) on page (one) an ajax call is made and it goes to the next page (two) so you see the products for that order. Now at the same time I want to refresh the ordernumber buttons on the first page so the clicked orderbutton dissapears after click on every device (lets say I am having it open on multiple devices). Whenever I refresh I am stuck at the same page. Also when I do auto refresh I need to trigger the styling of jquery mobile as it gets lost, when I do that it flickers as it goes to little button to big button in shorts amounts of time. I tried this:

function refreshone(){
$('#ordersdiv').load('getorders.php');
$('#ordersdiv').page('refresh');
$("#ordersdiv").trigger("create");
}

This function is called when the ajax call is complete after it goes to the second page. Yet it doesn't update anything and the orderbutton is still visible at the other devices.

Reload a Div with jquery timer

The answer on this question fixed it. Because of the Ajax that refreshes the page it doesn't blink when triggering the jquery mobile styling.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM