<a>标签绑定点击事件发送请求 即 标签超链接绑定点击事件发送请求
第一种
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>testLoad</title>
<script type="text/javascript" src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$("#user").click(url(){
window.location.href = "http://www.baidu.com";
});
})
</script>
</head>
<body>
<a href="#" id="user" onclick="url()">百度</a>
</body>
</html>
第二种
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>testLoad</title>
<script type="text/javascript" src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$("#sub").click(function(){
$("p").load("test.txt",aClick());
});
})
function aClick () {
window.location = "http://www.baidu.com";
}
</script>
</head>
<body>
<h2>点击按钮load</h2>
<p>this is paragraph to load</p>
<input type="button" name="sub" value="load" id="sub"></input><br>
<a href="javascript:void(0)" onclick="aClick()">百度</a>
</body>
</html>