How to navigate to another page on ajax success? I can't get it working! please help

So i’m using phonegap/framework7 for an app i’m working on

i have the following ajax call which works just fine…

        method: "POST",
        url: myApi+ "ratings",
        data: ratingForm,
        success: function() {

            //works fine
            alert("test success");

            //this part doesn't work!

        error: function () {
            app.dialog.alert('We apologize, an error 
occurred while trying to saving your rating.  Please try 

The part not working is the app.router.navigate("/success/"); part. I have no errors in the console. This function DOES work if called from anywhere else in the program, so i’m not sure how to handle redirecting after an ajax success, any help would be much appreciated.


thanks, i was able to figure it out…
I have the following view…

var composeView = app.views.create('#view-compose', { url: '/compose/' });

and on my ajax success i’m now doing…


and it is working perfect now. thanks for your reply