<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<style type="text/css">
</style>
<script src="jquery.js"></script>
<script>
$(function(){
$("#button1").click(function(){
$.ajax({
url : 'test.php',
type : "GET", //xhr.open();
data : "username=kjh", //xhr.send();
async : false, //是否异步
success : function(data) {
alert(data);
}
});
});
});
</script>
<body>
<div id="div1">
<input type="button" id="button1" value="提交">
</div>
</body>
</html>
test.php
<?php
echo $_GET[username];