记录a标签使用javascript:void(0) 与onclick来跳转页面的方法
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
<script type="text/javascript" src="cs.js"></script>
//cs.js里的内容:
//function Cs(event){window.location.href="https://www.baidu.com/";}
</head>
<body>
<a href="javascript:void(0)" οnclick="Cs();return false;">点击</a>
</body>
</html>
//在本页弹出一个窗口
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>菜鸟教程(runoob.com)</title>
<script type="text/javascript" src="tzlj.js"></script>
<script type="text/javascript">
function open_win()
{
window.open("http://www.w3school.com.cn","_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=800, height=600")
}
</script>
</head>
<body>
<a href="javascript:void(0)" οnclick="open_win();return false;" >点击</a>
</body>
</html>