Home  >  Article  >  Backend Development  >  ajax+php 无刷新问题。。。。 求大牛

ajax+php 无刷新问题。。。。 求大牛

WBOY
WBOYOriginal
2016-06-23 14:14:27846browse


    

        ajax+php 无刷新问题。。。。 求大牛" alt="">
    

    


    

        ">喜欢
        
    




<script> <br /> $(function(){ <br /> <br /> $(".xh").bind('click',function(){ <br /> var id = $(this).attr('vv'); <br /> $.ajax({ <br /> type:'POST', <br /> url:'__URL__/addnum', <br /> data:'id='+id, <br /> //dataType:"json", <br /> success:function(res){ <br /> var i = res; //服务器端返回的值 <br /> <br /> $(this).next().text(i); //这里怎么不能再无刷新状态改html页面的值??? <br /> <br /> } <br /> }); <br /> }); <br /> <br /> }); <br /> </script>
还有每个会员只能 点一次 click ,下次就不能点了。

回复讨论(解决方案)

  $(this).next().text(i);
你认为这个 $(this) 是谁?
难道不是 $.ajax 吗?

还有每个会员只能 点一次 click ,下次就不能点了。

直接做一个onclick事件,点击后把innerHTML链接去掉就可以了

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn