user4441 user4441 - 7 months ago 10
HTML Question

after insert data in database not able to redirect to html page?

$("#rec").click( function() {
$.post($("#ne").attr("action"), $("#ne :input").serializeArray(), function(info) {
$("#out").html(desc);
});
});

$("#ne").submit(function() {
return false;
});


rec
is the id of the HTML form and
out
is the id of a span tag in the same page as the form, i am not able to redirect after inserting record ?

Answer

use this method to redirect

window.location = "http://www.youtube.com";

or use this in your function where you want to redirect

$(this).attr("href","http://www.youtube.com");

give your own url