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
What do I exactly need is a handler which would be executed (if set of course) when an ajax request failed. Basically I'd like to be able to modify the behavior of "request()->error()" javascript function.
What more - in the handler, I'd like to have an option to cancel further processing of original error() .
Why? Because right now, when the session of my app expires, and let's say I try to create a new folder - I get an ugly response ("Data is not JSON...." with the source of login page).
Having proposed handler I could easily redirect to login page.
I think such a functionality could also be useful for done() and success().
PS. Of course globally for every command.
PS2. The handler should accept as a parameter the command name from which it was invoked and the final URL after an Ajax redirect (if there was one).
The text was updated successfully, but these errors were encountered:
@nao-pon It's a pleasure working with You. Nice and clean, works perfectly :)
Just one more question. I'm not quite sure (to be honest - I have no idea) how to display a modal dialog, with just a simple info, that the session timed out.
This is what I did. It works - almost... The dialog is not modal:(
if (loc) {
fm.error(["Your session expired. You'll be redirected to the login page.", ''], {modal: true});
// prevent showing error messages
e.preventDefault();
window.location = loc;
}
What do I exactly need is a handler which would be executed (if set of course) when an ajax request failed. Basically I'd like to be able to modify the behavior of
"request()->error()"
javascript function.What more - in the handler, I'd like to have an option to cancel further processing of original
error()
.Why? Because right now, when the session of my app expires, and let's say I try to create a new folder - I get an ugly response ("Data is not JSON...." with the source of login page).
Having proposed handler I could easily redirect to login page.
I think such a functionality could also be useful for
done()
andsuccess()
.PS. Of course globally for every command.
PS2. The handler should accept as a parameter the command name from which it was invoked and the final URL after an Ajax redirect (if there was one).
The text was updated successfully, but these errors were encountered: