1
if (selectedddItem.toString().indexOf("6ft with two") > -1) {
  window.location = "http://www.google.com/";
  alert("just passed over");
}

警报窗口打开,因此条件为真......但是浏览器没有重定向?!?!

有什么想法吗?

4

3 回答 3

3

根据您使用的浏览器,window.location =可能还不够。

尝试“完全合格”window.location.href = "http://www.google.com";

但是,该代码中的 jQueryfication 为零:-)

于 2011-03-18T18:00:13.260 回答
0
window.location.href

是你要找的

于 2011-03-18T17:59:56.527 回答
0

有这样的代码:

if (selectedddItem.toString().indexOf("6ft with two") > -1) {
  alert("just passed over");
  top.location.href = "http://www.google.com/";
}

确保您在浏览器重定向之前首先看到此警报,否则您的 if 条件返回 false。

于 2011-03-18T18:10:37.843 回答