link_to() for JS???

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
helloise
Forum Commoner
Posts: 31
Joined: Tue Sep 21, 2010 4:20 am

link_to() for JS???

Post by helloise »

how can i achieve this please?
i have:

Code: Select all

function getChoice(val)
{
  yesNo = new Array("Yes", "No");
  var getsel = document.contactus.yesnolist.value;
  var e = document.getElementById("yesnolist");
  var strUser = e.options[e.selectedIndex].value;
  if (strUser == "no")
  {
    //go the the faq page here??????
  }
  return strUser;
}
thank you
dgreenhouse
Forum Newbie
Posts: 20
Joined: Tue Mar 10, 2009 5:13 am

Re: link_to() for JS???

Post by dgreenhouse »

location.replace('http://example.com/');
or
location.href('http://example.com/'); // Adds an entry in the browser's history which could cause a redirection loop in some circumstances
Post Reply