简体   繁体   English

单击按钮时,转到下一页并刷新上一个Jquery Mobile

[英]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.

相关问题 Laravel提交按钮不会转到下一页和上一页 - Laravel submit button does not go to the next page and previous page 创建“后退”按钮,以转到jquery对话框中的上一页 - Creating a Back Button, to go to the previous page in a jquery dialog box 单击浏览器后退按钮时如何转到当前页面的上一页 - How to go previous page of current page , while clicking browser back button 按钮,一次无需数组刷新即可遍历数组一个值 - Button to go through array one value at a time without page refresh 如何将多个按钮单击变量传递给jQuery mobile中的下一页? - How to pass multiple button click variable to next page in jQuery mobile? 使用jQuery的下一个和上一个按钮 - Next and previous button using jquery 上一个按钮和下一个按钮在jQuery中不起作用 - previous button and next button is not working in jquery 单击分页的下一页按钮时,Word Press 中不出现下一页的内容 - when clicking the next button of pagination, not appearing the contents of next page in Word Press Cakephp 2,返回/取消按钮转到上一页 - Cakephp 2, back/cancel button to go to the previous page 用户按下后退按钮(注册后)刷新原始页面以导航到上一页 - Refresh the original page when a user presses back button (after registration) to navigate to previous page
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM