Today i face a problem while i am developing a client management system for one of my US client. The problem is that when i press button it call a php page . And the content load by jquery ajax call.
In that content there is a delete button. But the delete button event is not fire when i press button. Then i contact with one of my friend for this solution . He told me that i have to bind the method in the content after load the content. I search in my site , but didn’t able to get a better solution.
Al last after experimenting the code i am able to solve the problem. So that i think that this solution will help you to solve your problem .
View Demo:
The java script code is
<script type="text/javascript">
$(function()
{
$("#Search").click(function(){
$("#load").html(' <input type="button" id="delete" value="Search" />');
$("#delete").click(function(){
alert(this.id);
});
});
});
</script>
The html code is
<div id="content"> <input name="Search" type="submit" class="submit block" id="Search" value="Search" /> <div id="load"></div>
If you have any question then please inform us. We try to help. Hope this tutorial will help you.


