Я несколько дней искал решение проблемы, но не могу найти хитрость ..
Когда я загружаю внешнюю php-страницу в div и затем нажимаю на ссылку с внешним php-кодом, эта ссылка ничего не делает. Пожалуйста, посмотрите на этот код.
index.php
Тест
<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>
Есть идеи?
Спасибо