You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
I was wondering if there are plans on the roadmap to add some "safeguards" to this method since there will be users that change their mind and click on another item before a previous ajax call returns.
What's happening now is that multiple taps bound to $.mobile.changePage aren't aborting the current ajax request. They are simply being queued up and hence, every transition to a new page will include another ajax call from a previously queued item.
It would be nice if $.mobile.changePage can return an ajax object (XHR) so I can abort it on another tap.
And a callBack property would be nice too since I can technically disable all clickable objects and re-enable on ajax fail as well.
Note: This can be reproduced on jquery mobile demos as well. (Just go tap crazy on the list items :))
~Michael
The text was updated successfully, but these errors were encountered:
Note that Kin might of solved this with Issue #2503
If there are pagebeforeload, pageload, and pageloadfailed event handlers now, I can do the following:
<style>
#multiclickcatcher {z-index: 10000;position:fixed;top:0px;left:0px;width:100%;height:100%;text-align:center;vertical-align:middle;}</style><divid="multiclickcatcher"style="display: none;"></div><scripttype="text/javascript">
$('#multiclickcatcher').bind("click",function(){console.log('caught');});
$(document).bind( "pagebeforeload", function() {// Do what you want.$('#multiclickcatcher').css("display","block");});
$(document).bind( "pageloadfailed", function( event, data ) {// Do what you want.$('#multiclickcatcher').css("display","none");data.deferred.reject();});
</script>
This would safely intercept all clicks and ignore them so the AJAX queueing doesn't occur. On success, the multiclickcatcher gets reset with display=none.
Of course, more elegant solutions are always appreciated.
Hi,
I was wondering if there are plans on the roadmap to add some "safeguards" to this method since there will be users that change their mind and click on another item before a previous ajax call returns.
What's happening now is that multiple taps bound to $.mobile.changePage aren't aborting the current ajax request. They are simply being queued up and hence, every transition to a new page will include another ajax call from a previously queued item.
It would be nice if $.mobile.changePage can return an ajax object (XHR) so I can abort it on another tap.
And a callBack property would be nice too since I can technically disable all clickable objects and re-enable on ajax fail as well.
Note: This can be reproduced on jquery mobile demos as well. (Just go tap crazy on the list items :))
~Michael
The text was updated successfully, but these errors were encountered: