I use this code to refresh a div with the id="my":
<script type="text/javascript">
function recp() {
setInterval(function()
{
$("#my").load(location.href+ ' #my');
});
}
</script>
<div id="my"><?php echo date('a:i:s'); ?></div>
It works, but it generates this code:
<div id="my"><div id="my">pm:25:40</div></div>
How can refresh the div without generating a double div?
In other words how can refresh only this div:
<div id="my"><?php echo date('a:i:s'); ?></div>
add another div as a container and load content to it, like that.