日期:2014-05-16 浏览次数:20688 次
<?php
require 'global.php';
echo $_GET['name']."abc";
?>
<!DOCTYPE html>
<html>
<head>
<title>this is demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
</head>
<body>
<div>
<dl>
<dt>输入数据</dt>
<dd><input type="text" name="inC" /></dd>
</dl>
<input type="button" value="发送" id="btn" />
</div>
<div>
<dl>
<dt>接受数据</dt>
<dd><input type="text" name="onC" /></dd>
</dl>
</div>
<script type="text/javascript">
jQuery(function($){
$('#btn').click(function(){
$.ajax({
url: "/first.php",
type: "GET",
data: 'name='+$('input[name=inC]').val(),
beforeSend: function(){
$('#btn').attr('disabled','true').attr('value','send data');
},
success: function(d){
$('input[name=onC]').val(d);
}
});
});
});
</script>
</body>
</html>