Source Code

for file /AJAXEngine/S03_AJAXControls/SimpleBehaviour.htm

<!DOCTYPE html>
<html lang="en">
<head runat="server">
  <title>Simple behaviour demo</title>
  <link href="/mathertel.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="/controls/jcl.js"></script>
</head>
<body>
  <h1>Simple behaviour demo </h1>

<div id="TimerSample" style="width:200px;height:50px;font-size:20pt;background-color:yellow">click here</div>

<script type="text/javascript">

// TimerSampleBehaviour behaviour
// 22.08.2005 created

var TimerSampleBehaviour = {
  onclick: function (evt) {
    evt = evt || window.event; // get a compatible event object
    var t = evt.target || evt.srcElement;  // get a compatible target object
    t.update();
  }, // onclick

  update: function() {
    var d = new Date();
    this.innerText = d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
  } // update

} // TimerSampleBehaviour

jcl.LoadBehaviour(document.getElementById("TimerSample"), TimerSampleBehaviour);

</script>

<HR>

<P>This sample uses HTML, Javascript and the XMLHTTP object on the client to 
call a WebService.</P>
<P>This page is part of the <A 
href="http://ajaxaspects.blogspot.com/">http://ajaxaspects.blogspot.com/</A> 
project.</P>
</body>
</html>


This page is part of the http://www.mathertel.de/ web site.

For updates and discussions see http://ajaxaspects.blogspot.com/.