PHP Classes

File: List.php

Recommend this page to a friend!
  Classes of Michael J. Fuhrman   Contact Types   List.php   Download  
File: List.php
Role: Example script
Content type: text/plain
Description: Provides simple JQuery Functionality
Class: Contact Types
Manage a list of types of people contacts
Author: By
Last change:
Date: 14 years ago
Size: 1,105 bytes
 

Contents

Class file image Download
/* =======================================
    Copyright 1998 - 2010 - E Net Arch
    This program is distributed under the terms of the GNU
    General Public License (or the Lesser GPL).
    ======================================= */

// JQuery LITE =)
var $ = function (ID)
    {
        var thsID = document.getElementById (ID);
        // if (thsID == null) window.alert ("ID = " + ID + " not found!! ");
        if (thsID == null) return null;
        thsID.$ = next$;
        return thsID
    }
   
var next$ = function (thsChild)
    {
        nextID = getChild (this, thsChild);
        // if (nextID == null) window.alert ("thsChild = " + thsChild + " not found!! ");
        if (nextID == null) return null;
        nextID.$ = next$;
        return nextID;
    }

function getChild (currentElement, childElement)
{
    if (!currentElement) return;

    var i=0;
    var currentChild = currentElement.childNodes[i];

    while (currentChild)
    {
        if (currentChild)
            if (
                    (currentChild.tagName == childElement) ||
                    (currentChild.id == childElement)
                ) return currentChild;

        i++;
        currentChild = currentElement.childNodes[i];
    }
}