if (selectedddItem.toString().indexOf("6ft with two") > -1) {
window.location = "http://www.google.com/";
alert("just passed over");
}
警报窗口打开,所以条件为真...但是浏览器没有重定向?!?!
有什么想法吗?
最佳答案
根据您使用的浏览器,window.location =
可能不够。
尝试使用 window.location.href = "http://www.google.com";
但是,该代码中的 jQueryfication 为零 :-)
关于javascript - 为什么这不会导致浏览器重定向?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5355991/