Displaying 2 results from an estimated 2 matches for "foreachtostr".
2005 Sep 22
5
Prototype lib : for-each loops and DontEnum
...unction(msg)
{
alert(msg);
},
forToString: function()
{
document.writeln("<br /> c style for loop");
for (var i = 0; i < this.length; i++)
{
document.writeln("<br /> i["+i+"] = ["+this[i]+"]");
}
},
forEachToString: function()
{
document.writeln("<br /> for each loop");
for (var j in this)
{
document.writeln("<br /> j = ["+j+"]");
}
}
};
var q = new TestClass("a","b","c");
document.writeln("<br /><br...
2005 Oct 13
3
Tweaks of Array.prototype
Hi all,
I encountered a big problem when trying to use Scriptaculous and
Htmlarea in the same page.
The Htmlarea code uses a lot of "for (var i in array_variable)" to
iterate on array elements. Problem is that prototype.js augments
Array.prototype, which then show up in the iteration, severely breaking
htmlarea.
The easy workaround is for sure to use "for (var i = 0; i <