I've been lookings days for solving a problem, but i can not find the trick.. When i load an external php page into a div and click afterward on a link come with the external php code, this link does nothing. Please take a look at this code.
index.php Test
<script src="jquery.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function() {
$("#loadexternfile").bind("click", function(){
// some more events
loadContent();
});
$("#test").click(function() {
alert("Hello world!");
});
function loadContent() {
$.ajax({
type: "GET",
url: "external.php",
cache: false,
dataType: 'html',
success: function(html){
$(".loaddiv").html(html);
},
error: function(){
},
complete: function(){
}
});
}
});
</script>
</head>
<body>
<a href="#" id="loadexternfile">loadexternfile</a>
<div class="loaddiv"></div>
</body>
</html>
external.php
<a href="#" id="test">test</a>
Herhangi bir fikir?
Teşekkürler