The following is my ajax
$.ajax({
url: formUrl,
complete :function(){
$("#formContainer").removeClass("some-class");
},
success: function(response){
$("#formContainer").html(response);
initFunctionOne();
initFunctionTwo();
initFunctionThree();
}
});
}
'response' contains respective html forms in string format depending on what screen is being loaded. Is there any way i can get the form ID from that response so that I can use switch case statements to only call the function whose form ID matches with the form ID in the html response.
I'm initialising the three functions outside document.getready and the above mentioned ajax call is inside the document.getready
I've tried to use .find and .filter but both of them did not work due to an error (error : .filter is not a function)