Merge branch 'master' into topic/create_plant_entries
[sgn.git] / mason / counter.mas
blob07881cc0d514f54cda10107fc4bcddf2c3f1d2ed
2 <%doc>
4 =head1 DESCRIPTION
6 An example Mason component using javascript.
8 Doesn't do much. It is just displays a number that is incremented once every second. 
10 :-)
12 =head1 AUTHOR
14 Lukas Mueller
16 =cut 
18 </%doc>
20 <div id="counter" style="font-size:72pt; font-weight:bold; border:1px">0</div>
23 <script language="javascript">
25 var c = 0;
26 counter_div();
28 function counter_div() { 
29       var e = document.getElementById('counter');
31       c++;
32       e.innerHTML=c;
33       
34       setTimeout("counter_div()", 1000);
40 </script>