Login   Register  
PHP Classes
elePHPant
Icontem

File: ajax.js

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Danny Tucker  >  EZ Framework  >  ajax.js  >  Download  
File: ajax.js
Role: Application script
Content type: text/plain
Description: ajax js
Class: EZ Framework
Framework providing several types of functionality
Author: By
Last change:
Date: 2006-03-09 23:03
Size: 772 bytes
 

Contents

Class file image Download
// EZ XML By: Danny Tucker (c) 2006
var http = XMLObject();
function XMLObject()
{
    var xmlObject;
    var browser = navigator.appName;
    // Create XML Object based on broswer type
    if( browser == "Microsoft Internet Explorer" )
        xmlObject = new ActiveXObject( "Microsoft.XMLHTTP" );
    else
        xmlObject = new XMLHttpRequest( );
    return xmlObject;  
}
// send( Element ID to write output into, path to working file )
function send( objectID, path )
{
    // Open Worker Page
    http.open( 'get', path );
    http.onreadystatechange = function()
    {
        // If Worker Page Is Done Do Output
        if( http.readyState == 4 )
        {
            responseText = http.responseText;
            document.getElementById( objectID ).innerHTML = responseText;
        }
    }
    http.send( null );
}