Reputation: 385
if (selectedddItem.toString().indexOf("6ft with two") > -1) {
window.location = "http://www.google.com/";
alert("just passed over");
}
The alert window opens so the condition is true... however the browser doesn't redirect?!?!
Any thoughts?
Upvotes: 1
Views: 153
Reputation: 786329
Have your code like this:
if (selectedddItem.toString().indexOf("6ft with two") > -1) {
alert("just passed over");
top.location.href = "http://www.google.com/";
}
Make sure you are seeing this alert first before browser redirect otherwise your if condition is returning false.
Upvotes: 0
Reputation: 236202
Depending on the browser you are using, window.location =
might be not enough.
Try to "full qualify" with window.location.href = "http://www.google.com";
However, there is zero jQueryfication in that code :-)
Upvotes: 3