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

Reed Loden reed at reedloden.com
Mon Nov 21 16:40:07 EST 2005


On Mon, 21 Nov 2005 16:11:33 -0500 (EST)
trs at bestpractical.com wrote:

> Author: trs
> Date: Mon Nov 21 16:11:32 2005
> New Revision: 4126

> Modified: rt/branches/3.5-TESTING/html/NoAuth/js/util.js
> =======================================================================
> ======= --- rt/branches/3.5-TESTING/html/NoAuth/js/util.js	(original)
> +++ rt/branches/3.5-TESTING/html/NoAuth/js/util.js	Mon Nov 21 16:11:32 2005
> @@ -1,9 +1,23 @@
> -function e(id) {
> -    return document.getElementById(id);
> +// Stolen from Prototype
> +function $() {
> +  var elements = new Array();
> +
> +  for (var i = 0; i < arguments.length; i++) {
> +    var element = arguments[i];
> +    if (typeof element == 'string')
> +      element = $(element);

huh? I don't know JavaScript that well, but this looks like it is going to
go in a loop.

Jesse recommended the use of "element = document.getElementById(element);",
yet "element = $(element);" looks like it would call the function again,
again, and again.

Anyway, just my two cents.

~reed

-- 
Reed Loden - <reed at reedloden.com>


More information about the Rt-commit mailing list