62,266
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> 方法二</title>
</head>
<body>
<button onclick="window.location.replace('xx.aspx');">链接</button>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> 方法三</title>
<script type="text/javascript">
var aLink = document.createElement("a");
window.onload = function(){
document.body.appendChild(aLink);
}
function link(src){
aLink.href = src;
aLink.click();
}
</script>
</head>
<body>
<button onclick="link('xx.aspx');">链接到aspx</button>
</body>
</html>