Programming

Programming intro
Java

Markup

First webpage guide
HTML
XHTML

Style & Layout

CSS

Browser scripting

Javascript
VBScript
AJAX

Server scripting

PHP
ASP

Making money online

Make money online

AJAX core code

This is the core code needed to create an AJAX object:

<script type="text/javascript">
function ajaxDataGet(){

var ajaxObject;  //the variable that will store the object
	
  try{
	
	// Opera 8.0+, Firefox, Safari, Netscape 7
		ajaxObject = new XMLHttpRequest();
  } 
  
  catch (e){ 
	
	// Internet Explorer
		
	try{
	
   	  ajaxObject = new ActiveXObject("Msxml2.XMLHTTP");
		
	} 
	
	catch (e) { 
			
	  //if the above ActiveXObject did not work		
			
	  try{
		
		ajaxObject = new ActiveXObject("Microsoft.XMLHTTP");
		
		} 
		
		catch (e){
				//if AJAX is not supported at all
				alert("Your browser does not support AJAX!!");
				return false;
			}
		}
	}
}
</script>

The above is the core code to create an AJAX object.

The logical progression it follows is as such:

NOTE: You do not have to use the same exact code to create AJAX objects. But whatever code you use, the logical progression should be the same.

Reference
HTML/XHTML
CSS
Javascript
AJAX

Practice

Online code editor
Step-by-step tutorials
Practical examples
Practical exercises

Reference

Terms glossary

Rate this site

Rate this site
Visitor comments