0
my scenario is the following, I have a menu (class="menu") where any link that is clicked on it opens in a div ( div id="content")
the problem is that the links that open inside the content div even using the menu class in the links they do not open inside the divria itself? any idea what it might be?
$('.menu').on('click', function () {
$('#conteudo').load(this.href);
return false;
});
--> esses links carrega dentro da div conteudo OK
<a class="menu" href="pg1.php"></a>
<a class="menu" href="pg2.php"></a>
<a class="menu" href="pg3.php"></a>
<div id="conteudo" >
--> esse link nao carrega a pagina 4 dentro da propria div
<a class="menu" href="pg4.php"></a>
</div>
I may be mistaken more I believe that jquery does not see the newly loaded class within the div so it does not open within itself. some solution to this?
Utilize
$('#conteudo').on('click', '.menu a', function () {
 $('#conteudo').load(this.href);
 return false;
 });
– Valdeir Psr
ours that obvil, when if this inside the project does not see things simple, more somehow he did not recognize the (.menu a) only recognized the class without the link code (.menu)
– Arsom Nolasco
True. I ended up making a mistake with the
.menu a
– Valdeir Psr