JBottero
08-30-2009, 11:03 PM
I have an AJAX routine that calls a script that generates content that is dynamically => <div id="testdiv">inserted</div>.
I want to trap a click event:
$('testdiv').addEvent('click', function(){
alert('Hello');
});
But I'm getting an error message: 'null' is null or not an object
It works fine for hard coded code, but not code in the dynamically populated DIV.
Why? Workaround?
I want to trap a click event:
$('testdiv').addEvent('click', function(){
alert('Hello');
});
But I'm getting an error message: 'null' is null or not an object
It works fine for hard coded code, but not code in the dynamically populated DIV.
Why? Workaround?