Can't get the GrabOldMessages() function to run after the html() runs. Below is my code. Using jQuery version 1.7.2, I think I'm calling it back correctly, am I overlooking something? Please help me find my mistake. If you need me to provide anymore info, just let me know. Thank you for taking the time to help me.
//GRAB NEW MESSAGES
function GrabNewMessages(){
var doIB = encodeURIComponent("GET_DATA");
$.ajax({
type: 'POST', url: 'app/pull_data_files/inbox_NM_array.php', dataType: "json", data: { getInbox: doIB },
success: function(inbox_NM_data) {
if(inbox_NM_data[1] == 'true'){$('#inbox_NMlist_html').html(inbox_NM_data[0], function(){ GrabOldMessages(); });}
else{alert("Didn't work");}
}
});
return false;
}
//GRAB OLD MESSAGES
function GrabOldMessages(){
var doIB = encodeURIComponent("GET_DATA");
$.ajax({
type: 'POST', url: 'app/pull_data_files/inbox_OM_array.php', dataType: "json", data: { getInbox: doIB },
success: function(inbox_OM_data) {
if(inbox_OM_data[1] == 'true'){$('#inbox_OMlist_html').html(inbox_OM_data[0], function(){GoToInbox();});}
else{alert("Didn't work");}
}
});
return false;
}
The load event is sent to an element when it and all sub-elements have been completely loaded. This event can be sent to any element associated with a URL: images, scripts, frames, iframes, and the window object.loadwill not work when bound to adivfor example.