javascript - How to redirect user to another internal page? -


after creating record, user redirected internal page.

"redirect home.html" 

i've tried, add code under "sucess" had no success :( how redirected after register or log in?

window.location.href = "http://stackoverflow.com"; 

with above code works after pressing f5

<script type="text/javascript">        parse.initialize("uwkfsq1dy.......", "mgi77........");        var post = parse.object.extend("post");         $("#signup").submit(function(event){          event.preventdefault();           var username = $("#signup-username").val();          var pass = $("#signup-password").val();          var email = $("#signup-email").val();           var user = new parse.user();          user.set("username", username);          user.set("password", pass);          user.set("email", email);           user.signup(null, {            sucess: function(user){             window.location.href = "http://stackoverflow.com";            }, error: function(user, error){              console.log("signup error:"+error.message);            }          });        });   </script> 

you start changing sucess success try window.location = "http://www.yoururl.com"; or window.location.href = "whatever" or window.location.replace("http://www.yoururl.com/");

then add return it. , if doesn't still work? try using settimeout.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -