I am using jquery and having a problem with binding to return data from the web server. The data is coming back as HTML.
Here's what happens....
- User clicks a link and a dialog box opens up. The addToCurrent button is binded to a click event.
- The user submits the data to the web server and the returnFromAdd() is called on the return data.
- Try to rebind the addToCurrent button in the new data but it doesn't happen.
The code below is the basics of what I am trying to do. If you have any suggestions let me know.
function bindAddGroupButtons() {
$("#addToCurrent").click(function() { alert("here") });
}
$(".linkButton").click(function() {
$.get("someURL", function(data) {
$('#addGroupModal').html(data);
$('#addGroupModal').dialog("open");
bindAddGroupButtons();
});
});
/*** callback function dialog post **/
function returnFromAdd(data) {
$('#addGroupModal').html(data);
bindAddGroupButtons();
}