[英]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. 我有一个Jquery Mobile应用程序,当我单击页面(一个)上的按钮(订单号)时,进行了ajax调用,然后转到下一页(两个),因此您会看到该订单的产品。 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.
另外,当我执行自动刷新时,我需要触发丢失的jQuery Mobile样式,当我这样做时,它会在短时间内从小按钮变为大按钮而闪烁。 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. 当ajax调用在转到第二页后完成时,将调用此函数。 Yet it doesn't update anything and the orderbutton is still visible at the other devices.
但是它不会更新任何内容,并且在其他设备上仍然可以看到orderbutton。
Reload a Div with jquery timer 用jQuery计时器重新加载一个div
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.
由于Ajax会刷新页面,因此在触发jquery移动样式时它不会闪烁。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.