I have a simple code like:
<html>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<body>
<a href="#" class="plink">Click me</a>
<div class="cnt">
</div>
<script>
$(document).ready(function(){
$(".plink").click(function(){
alert("A");
});
$.ajax({
url: 'do.php?a=getinfo',
type: 'POST',
success: function(result) {
$(".cnt").html(result);
}
});
});
</script>
</body>
</html>
From ajax query I get this:
<a href="#" class="plink">Click me 2</a>
The problem is that when I click on a link (Click me 2) that I get from ajax query, assigned for this link event doesn't work, i.e. alert("A")
doesn't show.
So, is there any way to solve this problem?