Page 1 of 1

link_to() for JS???

Posted: Thu Mar 24, 2011 7:41 am
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

Re: link_to() for JS???

Posted: Sun Mar 27, 2011 6:44 am
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