jQuery selectors with ajax
Posted: Mon Mar 24, 2008 3:35 pm
I have some data that's being loaded in via jQuery's .load function... I want to add a hover attribute to items within that loaded div, but it doesn't appear to work because the actual elements aren't in the source, since their being loaded via ajax.
For example, here's what I have..
Any ideas how to get this to work? Thanks!
For example, here's what I have..
Code: Select all
$(document).ready(function(){
$('#divTest li').hover(function() {
alert('test');
})
});
Code: Select all
<div id="Data"></div>
This is the div that's being loaded from another page with the following content...
<div id="divTest">
<ul>
<li>some data</li>
</ul>
</div>