日期:2014-05-16 浏览次数:20433 次
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<script type="text/javascript">
xmlHttp = new XMLHttpRequest();
function click_A(value){
xmlHttp.open('GET','test.php?click=1',true);
xmlHttp.onreadystatechange = function(){
if((xmlHttp.readyState == 4)&&(xmlHttp.status ==200)){
document.getElementById('click').innerHTML = xmlHttp.responseText;
}//end of if
}//end of on readystatechange
xmlHttp.send();
}
</script>
<body>
<a id="click" onclick="click_A()">我是标签a,点击我</a>
</body>
</html>
<?php
if($_GET['click']){echo "<br />标签a已经被点击了";}
?>
<a onclick="func(this)">你</a>
<script>
function func(obj){
obj.innerHTML='好';
}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function (){
$("a").click(function(){
$(this).text('好');
});
})
</script>
<a href="#">你</a>