Ajax之GET请求

 

<input type="text" name="username"/><span id="reg"></span>

<script src='jquery.js'></script>
<script>
    $('input:text').blur(function(){
      var url='24.php?u='+$(this).val()
      $.get(url,function(res){
      if(res=='1'){
        $('#reg').html('<font color="red"> 不可用</font>')
       }else{
        $('#reg').html('<font color="blue">可用</font>')
    }
  })
})


</script>

 

posted @ 2015-11-20 16:12  葛磊博客  阅读(169)  评论(0编辑  收藏  举报