Login   Register  
PHP Classes
elePHPant
Icontem

File: jquery_lite.js

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Michael J. Fuhrman  >  Contact Types  >  jquery_lite.js  >  Download  
File: jquery_lite.js
Role: Auxiliary data
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: 2010-07-09 15:37
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];
	}
}