a question, I use jquery to automatically reload every 5 seconces a remote php page. No problem. This page contains assets (clickable), and I can not make it work. the element appears inactive. I said that I want to use for another jquery fontion.
Index.html :
<html>
<head>
<meta charset="utf-8" />
<title>CPAC</title>
</head>
<body>
<a title="" style="padding : 1px 2px;" href="#" class="cl"><img src="images/fastcoin.png"></a>
<div id="lWorkers">Loading ...</div>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var interval = 5000;
var refresh = function() {
$.ajax({
url: "lWorkers.php",
cache: false,
success: function(data) {
$( "div#lWorkers" ).html(data);
setTimeout(function() {
refresh();
}, interval);
}
});
};
refresh();
$(".cl").click(function() {
alert( "toto" );
return false;
});
});
</script>
</body>
</html>
And lWorkers.php sample return :
<a title="" style="padding : 1px 2px;" href="#" class="cl"><img src="images/fastcoin.png"></a>
<a title="" style="padding : 1px 2px;" href="#" class="cl"><img src="images/fastcoin.png"></a>
<a title="" style="padding : 1px 2px;" href="#" class="cl"><img src="images/fastcoin.png"></a>
<a title="" style="padding : 1px 2px;" href="#" class="cl"><img src="images/fastcoin.png"></a>