0
How can I make the elements loaded in the layout be seen by jQuery?
For example: on a parent page I have a script loaded with the page. On this parent page, I have a DIV
with ID="filho"
. When, a button on the parent page is clicked, I press the result in this "child" DIV. However, if I want to access some element that has just been loaded through jQuery that is already loaded on the page, it does not work. It’s like it doesn’t exist. How to solve this?
Can you put your code here? I think the problem is delegation. You should use
$(pai).on('click' ,'filho', function(){ ...
– Sergio
I understood the link you posted before. But, what about when the event is not triggered via click? Example: $(Document). ready(Function(){ load a page via load or ajax ...});
– morphinduction
The best is to put a concrete example of code. Without seeing can be a lot...
– Sergio
Your explanation is very confusing, try to put part of the code to better view the problem and explain in topics.
– Paulo