if (selectedddItem.toString().indexOf("6ft with two") > -1) {
window.location = "http://www.google.com/";
alert("just passed over");
}
警报窗口打开,因此条件为真......但是浏览器没有重定向?!?!
有什么想法吗?
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 为零:-)
window.location.href
是你要找的
有这样的代码:
if (selectedddItem.toString().indexOf("6ft with two") > -1) {
alert("just passed over");
top.location.href = "http://www.google.com/";
}
确保您在浏览器重定向之前首先看到此警报,否则您的 if 条件返回 false。