标签: javascript href
正文标记:<a href="javascript:gotoURL();">T&Cs</a>
<a href="javascript:gotoURL();">T&Cs</a>
头标记:
function gotoURL() { window.location = 'someurl.html'; }
不工作,不知道吗?
答案 0 :(得分:3)
修改功能:
function gotoURL() { window.location.href = "someurl.html"; }
来源:How can I make a redirect page in jQuery/JavaScript?