NEVER do
for (x in array)
for an array (only with objects). Do
var i, len=contents.length;
for (i=0; i<len; i++) {
}
instead and all will be fine with all browsers. Google to find out what the
problem of for (x in array) is ...
Cheers,
Fritz
On Mon, 4 Oct 2010, Ed Adasiewicz wrote:
>
> In my case I have a SelectBox which stays around for a long time and gets
> re-populated periodically based upon a user's input so I wanted to dispose
> of everything before I re-populate it. If I write a quick-n-dirty function
> which shows the children, I get different results based upon the browser.
> For example, assuming that list is the SelectBox:
>
> var contents = list.getChildren();
> for (var item in contents) {
> alert(typeof item + " " + item);
> }
>
> If there were 3 items added to the SelectBox, all 3 browsers (firefox
> 3.6.10, chrome 7.0.517.24 beta and IE 8 running in winxp in virtualbox) all
> show string 0, string 1 and string 2. But chrome and ie also show string
> indexOf, string lastIndexOf, string forEach, string filter, string map,
> string some and string every; and these should not be deleted. I though I
> would be able to filter on typeof but it seems like I have to check if item
> is a numeric string?
>
--
Oetiker+Partner AG tel: +41 62 775 99 03 (direct)
Fritz Zaucker +41 62 775 99 00 (switch board)
Aarweg 15 +41 79 675 06 30 (mobile)
CH-4600 Olten fax: +41 62 775 99 05
Schweiz web: www.oetiker.ch
------------------------------------------------------------------------------
Virtualization is moving to the mainstream and overtaking non-virtualized
environment for deploying applications. Does it make network security
easier or more difficult to achieve? Read this whitepaper to separate the
two and get a better understanding.
http://p.sf.net/sfu/hp-phase2-d2d
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel