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
Hi there
I develop a mobile app with a
controller > view architecture combined with asynchronous AJAX requests.
In order to avoid memory leaks, in destroy current controller and view (DOM) when the user switch back to a previous view ([back] button ...)
My onSuccess method uses to update the view depending on data retrieved from the AJAX call and that's why I don't want it to be executed if the user left this view cause it's not surprisingly generating javascript errors ...
tests I have to do are always the same and that's why i didn't want to put them in each of my onSuccess methods (many) since I have an onComplete method which is common to all my requests.
Then here is what I do:
onComplete: function(e)
{
if(my tests are not OK) {
this.removeEvents().setOptions({timeout:0}).cancel();
return;
}
...
few other things if tests are OK
...
}
This is working correctly (onSuccess method is not executed) if the user switch back fast enough on the previous view ([back] button) but not if he waits to long (like 0.5 or 1s more).
Here is what is see in mootools-core source code.
Hi there
I develop a mobile app with a
controller > view architecture combined with asynchronous AJAX requests.
In order to avoid memory leaks, in destroy current controller and view
(DOM) when the user switch back to a previous view ([back] button ...)
My onSuccess method uses to update the view depending on data retrieved
from the AJAX call and that's why I don't want it to be executed if the
user left this view cause it's not surprisingly generating javascript
errors ...
tests I have to do are always the same and that's why i didn't want to put
them in each of my onSuccess methods (many) since I have an onComplete
method which is common to all my requests.
Then here is what I do:
onComplete: function(e)
{
if(my tests are not OK) {
this.removeEvents().setOptions({timeout:0}).cancel();
return;
}
...
few other things if tests are OK
...
}
This is working correctly (onSuccess method is not executed) if the user
switch back fast enough on the previous view ([back] button) but not if he
waits to long (like 0.5 or 1s more).
Here is what is see in mootools-core source code.
Hi there
I develop a mobile app with a
controller > view architecture combined with asynchronous AJAX requests.
In order to avoid memory leaks, in destroy current controller and view (DOM) when the user switch back to a previous view ([back] button ...)
My onSuccess method uses to update the view depending on data retrieved from the AJAX call and that's why I don't want it to be executed if the user left this view cause it's not surprisingly generating javascript errors ...
tests I have to do are always the same and that's why i didn't want to put them in each of my onSuccess methods (many) since I have an onComplete method which is common to all my requests.
Then here is what I do:
This is working correctly (onSuccess method is not executed) if the user switch back fast enough on the previous view ([back] button) but not if he waits to long (like 0.5 or 1s more).
Here is what is see in mootools-core source code.
I thought that onSuccess method were executed only when onComplete method has finished. Isn't it the case ?
Do you have an idea of how I should do ?
Best
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: