treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] Problems with JQuery Ajax return

  • This is really confusing me.

    I have a JQuery AJAX call which works fine and returns all the data required. It also returns a drop-down box full of data and button to submit whatever is in the drop down box.

    The problem is that I cannot bind a click event to the button returned by the Ajax call. The following code does nothing:

    $(\"#loadFloor\").click(function(){
    alert(\"True\");
    });


    Any ideas? Live example is at http://homepages.shu.ac.uk/~msinkins/ and you click on 'Furnival' in the breadcrumbs
  • Never mind, worked it out. Turns out the click function needs to be inside the AJAX call-back and will not work if it is in the general Javascript