Je table html comme ceci:Jquery mouseenter ne se déclenche pas après le changement html
<div id="recommendation">
<table id="category_selected">
<tr>
<td>1</td>
</tr>
</table>
</div>
et jquery comme ceci:
$(function()
{
$("#recommendation tr").mouseenter(function()
{
alert("Yes");
}
}
et tout fonctionne bien. Mais quand je change html de recommandation ceci:
$.post("path/script.php", {dataIn: dataInEncoded}, function(data, status)
{
if(status == 'success')
{
$("#recommendation").html(data);
/*(data exactly the same as default html)
<table id="category_selected">
<tr>
<td>1</td>
</tr>
</table>
*/
}
}
Jquery mouseenter ne fonctionne pas soudainement (déclencheur).
quelle est la réponse que vous obtenez dans votre demande ajax? – mrid