如题所述
第1个回答 推荐于2016-07-16
<script>
function ajax_fun(){
$.ajax({
type:'post',
data:$('#user').val(),
url:'login.php',
success:function(response){
alert(response);
}
});
}
</script>
<form >
<input id='user' name ="username" />
<input type="button" value="提交" onclick="ajax_fun()" />
</form>本回答被提问者采纳
function ajax_fun(){
$.ajax({
type:'post',
data:$('#user').val(),
url:'login.php',
success:function(response){
alert(response);
}
});
}
</script>
<form >
<input id='user' name ="username" />
<input type="button" value="提交" onclick="ajax_fun()" />
</form>本回答被提问者采纳