javascript小问题:
我在一个aspx页面中给一个按钮加个onclick="test()"
其中
function test()
{
window.location="http://localhost/test/index.aspx";
}
我的目的就是通过按钮转向一个新的页面。
javascript偶不是很懂,请高手赐教!
我在一个aspx页面中给一个按钮加个onclick="test()"
其中
function test()
{
window.location="http://localhost/test/index.aspx";
}
我的目的就是通过按钮转向一个新的页面。
javascript偶不是很懂,请高手赐教!
function test()
{
location.href = "http://localhost/test/index.aspx";
}
</script><input type="button" onclick="test();" value="点我">
<script language="javascript">
function test()
{
location.href = "../index.aspx"; //这里的页面可根据你的实际情况指定
}
</script>
放在<head>与</head>中调用的话,就像楼上所说的:
<input type="button" onclick="test();" value="点我">