This line is wrong

> success: function() {  {{redirect(URL(f="mathgen"))}}    }

because everything inside {{....}} is executed by the server BEFORE
the page is rendered and returned to client, therefore it is executed
before the client executes any JS, before the Ajax call, before the
success function. That is not what you want. You want the redirection
to be done on success, after the ajax call. Therefore it must be in
JS:

 > success: function() {  document.location="{{=URL("mathgen")}}";    }

Reply via email to