gpt4 book ai didi

javascript - 重定向在 Firefox 中不起作用

转载 作者:行者123 更新时间:2023-11-28 12:34:21 24 4
gpt4 key购买 nike

我有一个小功能,可以根据文本值输入将用户重定向到搜索结果页面,我在 Javsacript 中使用的重定向功能在 IE 和 Google Chrome 中运行良好,但在 fireFox 中不起作用。

$(document).on("click", "input[name='btnSearchTest']", function () {
//alert('test');


var txtBoxValue = $('#txtSearchGeneral').val();
if (txtBoxValue == "") {
alert("Please enter a value");
return false;
}
window.event.returnValue = false;

document.location = "SearchResults.aspx?search=" + txtBoxValue;

关于如何在 Firefox 中使用 javascript 完成重定向的任何建议

问候

最佳答案

使用

   window.location.href = "SearchResults.aspx?search=" + txtBoxValue;

关于javascript - 重定向在 Firefox 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18712864/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com