I want to know how to do $('#div-search').on('load', ()=>{alert('carregou');});
I have a div
where there are several $('#div-search').load(url)
in the code.
however now I need to perform a series of validations after loading it.
I have tried the following tests:
$('#div-search').on('load', ()=>{alert('carregou');});
$('#div-search').on('ready', ()=>{alert('carregou');});
$('#div-search').ready( ()=>{alert('carregou');});
and none of them worked.
P:
) 1. Why do not I want to have to search all code for calls; > 2. Because it is not always fixed $ ('# div-search') , it is often a variable $ (selectorId) and, in addition be harder to find, I would have to do an IF;