AJAX problem

Hi,

Can anyone tell me how to get round this …




<body>


<div id="container">

</div>


<script>

jQuery('#test').click(function() {

alert("hi");

}

</script>

</body>



From the server end, I fill the html "container" division with <p id="test">Hello World</p> or something similar, something with the ID of test.

But because its being filled in from the server end, when I click #test nothing happens.

execute the script you posted on the complete event of the ajax request

or do the following




jQuery('#test').live('click',function(){

  alert('Hello world!');

});