$(document).ready(function() { setinterval(function() { $.get("temp.php", function(temp) { $("deneme span").html(temp); $("#deneme").html(temp); }); }, 3000); }); <div class="container"> <div class="de"> <div class="den"> <div class="dene"> <div class="denem"> <div class="deneme" id="deneme"> <span></span><strong>°</strong> </div> </div> </div> </div> </div> </div> </center>
that's because .html() replaces html inside div.
so $("deneme span").html(temp); trying fill-up span, $("#deneme").html(temp); removing whole content , replacing temp.
i suggest use .append() add div.
Comments
Post a Comment