在数据库中插入数据后,无法重定向到 HTML 页面

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

本文关键字:重定向 HTML 页面 数据库 插入 数据      更新时间:2023-09-26
$("#rec").click( function() {                                 
    $.post($("#ne").attr("action"), $("#ne :input").serializeArray(), function(info) { 
        $("#out").html(desc);  
    });  
});  
$("#ne").submit(function() {  
    return false;  
}); 

rec是 HTML 表单的 id,out是与表单位于同一页面的 span 标签的 id,插入记录后我无法重定向?

你可以使用它

window.location.reload();

window.location = "add your link here";

$(this).attr("href","add your page link here");

window.location.replace("add your page link here");

使用此方法

与 HTTP 重定向类似的行为

window.location.replace("http://yoursite.com");

与点击链接类似的行为

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