html + js实现点击跳转,无需jquery
可以减少冗余的头部地址
<p onclick="a('abc.html')">hello</p>
<p onclick="a('def.html')">hello</p>
<script>
function a(v) {
//打开新页面
window.open('file://E:/dick/html/' + v);
//window.location.href = 'file://E:/dick/html/' + v; 本页面内跳转
}
</script>
<p onclick="a(this)" pussy='abc.html'>hello</p>
<p onclick="a(this)" pussy='def.html'>hello</p>
<script>
function a(v) {
window.open('file://E:/dick/html/' + v.getAttribute('pussy'));
}
</script>