Looking to Build/Redesign a Website or Blog ?

To speak to Rakshit, call +91 968 704 2303

Problem solved: Recursive jQuery-AJAX Click Bind event

Hello Friends,

If you are working with jQuery-Ajax, than this might be useful tutorial for you. While using jQuery-Ajax, you will get a response and you will place that response (May be in form of HTML) in some div or table. Now if you want to do any jQuery event on response (for e.g. if you need to make a click event on <a href=””></a> link which is in response) than you need to bind this click event success area of jQuery-Ajax call. You can do this once but again when you receive response, you need to make bind event. So you can say this is recursive jQuery-Ajax call.  So for this you need to make a separate function and call that function recursively. Look at below code.

function getData()
id_clicked = $(this).attr(‘id’);
// process here
url: url here,
success: function(data) {

if(data != ”)

Let me know if you find any problem.



  • Birkenstock 37…

    […]Problem solved:Recursive jQuery-AJAX call | Programming Facts -PHP Freelancer-Indian Freelancer[…]…

  • Luis

    I apply this solution but i have a problem. This is my code:


    var code = 0;
    function anchorClick(e){
    liid = $(this).attr(“id”);
    type: “GET”,
    url: “file.php”,
    data: “id=” + code,
    error: function(jqXHR, textStatus, errorThrown){alert(textStatus);},
    success: function(returnedData){


    echo "a”;

  • I enjoy reading a post that can make men and women think.
    Also, thanks for permitting me to comment!

Leave a Reply

Your email address will not be published.