Simple AJAX optimization

When ever we write an ajax code to create the AJAX objectwe tend to do it like:

function createAjaxObject()
{
if(window.XMLHttpRequest)
{
ajaxObject =  new XMLHttpRequest();
return ajaxObject;
}
else if(window.ActiveXObject)
{
ajaxObject = new ActiveXObject(”Microsoft.XMLHTTP”); Read the rest of this entry »