How do I debug jquery AJAX calls?

后端 未结 10 1349
悲&欢浪女
悲&欢浪女 2020-11-29 05:19

I have been working on trying to get AJAX to work with Jquery. My big issue so far has been that I don\'t really know how to figure out where I\'m making a mistake. I don\'t

10条回答
  •  独厮守ぢ
    2020-11-29 05:44

    you can use success function, once see this jquery.ajax settings

     $('#ChangePermission').click(function(){
        $.ajax({
            url: 'change_permission.php',
            type: 'POST',
            data: {
            'user': document.GetElementById("user").value,
            'perm': document.GetElementById("perm").value
            }
           success:function(result)//we got the response
           {
            //you can try to write alert(result) to see what is the response,this result variable will contains what you prints in the php page
           }
        })
    })
    

    we can also have error() function

    hope this helps you

提交回复
热议问题