I am doing a search and php is returning the results correctly. Part of the returned html includes a href. The href does not work, the console is reporting ‘deleteCatalogue’ is not defined. I am guessing that the updated DOM cannot find the defined function in the js file linked to index.html.
What is the best way to ensure any updates to the DOM sync any selectors in the loaded html with any methods/functions loaded prior to callback?
Index.html executes:
[CODE]function searchCatalogue(search) {
var dataString = ‘search=’+search;
$.get(‘php/catalogue_search2.php’,
dataString,
function(returnData) {$(“#search_results”).html(returnData);
});
};
href:
[code=html]<a class=’actions’ href=’#’ onclick=”deleteCatalogue($(this).closest(‘.row’).attr(‘id’))”>delete</a>
Thanks, James