[jQuery] prob with
[jQuery] prob with
Hi,
I have a problem with jquery recognizing elements of html that was
inserted via ajax.
here is the main html file where I input the ajax result
<body>
<div id='thesView'>xxx</div>
</body>
this is the html file that I include:
<div class='center'>HEAT</div>
<div class='left'>ccc</div>
an this is my js file
test = {
load : function(){
var oThis = this;
$('#thesView').load('database.html', '', oThis.afterLoad());
},
afterLoad : function(){
this.addBehaviour()
},
addBehaviour : function(){
$('#thesView > div').click(function(){
alert('click')
})
// $('div').click(function(){
// alert('this works!!!!!')
// })
}
}
jQuery(function() {
test.load()
})
now the file is loaded and put into the main div .. yet the click
event is not set.. as you can see the commented code would work
though... do I overlook anything that badly=???