javascript - Unable to redirect to html page after inserting form data into database -
$("#sub").click( function() { $.post($("#new_user").attr("action"), $("#new_user :input").serializearray(), function(info) { $("#result").html(info); }); clearinput(); }); $("#new_user").submit(function() { return false; }); function clearinput() { $("#new_user :input").each(function() { $(this).val(''); }); }
here sub
id of html form , result
id of span tag in same page form. looking redirect same html page after inserting in database, not happening. insertion happening properly.
use method redorect
window.location = "http://www.youtube.com";
or use in function want redirect
$(this).attr("href","http://www.youtube.com");
give own url
Comments
Post a Comment