[Rt-commit] r4125 - in rt/branches/3.5-TESTING: . html/NoAuth/js

Jesse Vincent jesse at bestpractical.com
Mon Nov 21 16:07:37 EST 2005


> Probably.  I didn't make it $(id) because I didn't know if Prototype was 
> doing anything different behind the scenes that it would miss if 
> overridden by our own function.
> 


function $() {
  var elements = new Array();

  for (var i = 0; i < arguments.length; i++) {
    var element = arguments[i];
    if (typeof element == 'string')
      element = document.getElementById(element);

    if (arguments.length == 1)
      return element;

    elements.push(element);
  }

  return elements;
}

> Tom
> _______________________________________________
> Rt-commit mailing list
> Rt-commit at lists.bestpractical.com
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-commit
> 

-- 


More information about the Rt-commit mailing list