How to refresh DIV / DIV tag frissitése JavaScripttel

How to refresh DIV / DIV tag frissitése JavaScripttel

Postby rtuszendi » 2013.04.02. 18:23

How to refresh DIV / DIV tag tartalmának frissitése JavaScripttel


You the setInterval method of window obj to set the refersh interval and the javascript function which should be invoked on refresh. In the javascript function, update the div content. Something like this should work:


Code: Select all
<html>
   <head>
      <script langauge="javascript">
         var counter = 0;
         window.setInterval("refreshDiv()", 5000);
         function refreshDiv(){
            counter = counter + 1;
            document.getElementById("test").innerHTML = "Testing " + counter;
         }
      </script>
   </head>
   <body>
      <div id="test">
         Testing
      </div>
      <div id="staticBlock">
         This is a static block
      </div>
   </body>
</html>
User avatar
rtuszendi
Adminisztrátor
 
Posts: 326
Joined: 2012.02.03. 20:26
Location: Hungary, Debrecen
Country: Hungary
city: Debrecen

Return to JavaScript

Who is online

Users browsing this forum: No registered users and 1 guest

cron


Flag Counter