javascript - Trying to redirect to page on click -


no expert when comes js/jquery, im trying use code, , once registration sign done correctly, , information stored, instead of alert box, wanna have redirect web page... ive got far, ive tried few things, none seem working... doing wrong, , how fix this?

$(document).ready(function () {     $("#register").click(function () {         var name = $("#name").val();         var email = $("#email").val();         var password = $("#password").val();         var cpassword = $("#cpassword").val();         if (name == '' || email == '' || password == '' || cpassword == '') {             alert("please fill fields...!!!!!!");         } else if ((password.length) < 8) {             alert("password should atleast 8 character in length...!!!!!!");         } else if (!(password).match(cpassword)) {             alert("your passwords don't match. try again?");         } else {             $.post("register.php", {                 name1: name,                 email1: email,                 password1: password             }, function (data) {                 if (data == 'you have registered.....') {                       $("form")[0].reset();                     }                alert(data);              });          }      }); }); 

if (data == "index.html"){     //... } 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -