AJAX - Client Side: JavaScript Events and the DOM



AJAX Client Side Step By Step Tutorial - part 4: At this post, we will try JavaScript events to generate part of page dynamically.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>AJAX-Client Side: JavaScript Event</title>
<script type="text/javascript">
function clickme(){
  window.document.form1.button1.value = "Clicked";
  txt.innerText = "Thanks...";
  document.title = 'Clicked!';  
}
</script>
</head>
<body>
<form name="form1">
  <p id="txt">Click this button</p>
  <input type="button" name="button1" value="Click Me!" 
   onclick="clickme()">
</form>
</body>
</html>

Open that page:

ajax dom before

Now, click the button.

ajax dom after


Series this article:
AJAX - Client Side: Techniques Introduction
AJAX - Client Side: JavaScript Overview
AJAX - Client Side: JavaScript and Document Object Model
AJAX - Client Side: JavaScript Events and the DOM
AJAX - Client Side: JavaScript, DOM, and CSS
AJAX - Client: XMLHttpRequest Object
AJAX - Client Side: Initiating Server Request Using XMLHttpRequest
AJAX - Client Side: Handling Server Response
AJAX - Client Side: Making Asynchronous Calls with XMLHttpRequest
AJAX - Client Side: Working with XML Structure
AJAX - Client Side: Processing XML Data use XMLHttpRequest
AJAX - Client Side: Simple Application for Process XML data


Tag: AJAX, client side, javascript, dom, document object model, event, javascript events Category: PHP Application Post : March 08th 2008 Read: 2,283 Bookmark and Share

blog comments powered by Disqus