Hello Michael,
qooxdoo adds these methods to the native array in IE. Firefox has these
convenience methods already included so we dont need to add them. Thats why
you get these methods in IE and not in any other browser.
But as you said, its always a good idea not to use the for in loop with
arrays. That way, the methods added by qooxdoo do not harm your code.
Regards,
Martin
Michael Helwig wrote:
>
> Sorry, I think I solved it. The output seems just to be the normal debug
> output under IE since the array length is as it should be. My problems
> with these arrays seem to be caused by "for ... in" loops. IE seems to
> iterate also over the object functions which it outputs in the debug
> console, while FF does not. I better avoid these loops in IE, I guess.
>
> Greets,
>
> Michael
>
> Michael Helwig schrieb:
>> Hello,
>>
>> I'm experiencing problems when dealing with Strings in IE. For example,
>> calling the following function in FF works fine:
>>
>> [CODE]
>> var stringArray = qx.lang.String.toArray(someString);
>> [/CODE]
>>
>> But in IE the stringArray contains a lot of stuff that doesn't belong
>> there. Setting someString to "Test1 Test2",
>> qx.dev.Debug.debugObject(stringArray) gives me in IE:
>>
>> [DEBUG]
>> 0: T
>> 1: e
>> 2: s
>> 3: t
>> 4: 1
>> 5:
>> 6: T
>> 7: e
>> 8: s
>> 9: t
>> 10: 2
>> indexOf: function(searchElement, fromIndex)
>> {
>> if (fromIndex == null) {
>> fromIndex = 0;
>> } else if (fromIndex < 0) {
>> fromIndex = Math.max(0, this.length + fromIndex);
>> }
>>
>> for (var i=fromIndex; i<this.length; i++)
>> {
>> if (this[i] === searchElement) {
>> return i;
>> }
>> }
>>
>> return -1;
>> }
>> lastIndexOf: function(searchElement, fromIndex)
>> {
>> if (fromIndex == null) {
>> fromIndex = this.length - 1;
>> } else if (fromIndex < 0) {
>> fromIndex = Math.max(0, this.length + fromIndex);
>> }
>>
>> for (var i=fromIndex; i>=0; i--)
>> {
>> if (this[i] === searchElement) {
>> return i;
>> }
>> }
>>
>> return -1;
>> }
>> forEach: function(callback, obj)
>> {
>> // The array length should be fixed, like in the native
>> implementation.
>> var l = this.length;
>>
>> for (var i=0; i<l; i++) {
>> callback.call(obj, this[i], i, this);
>> }
>> }
>> filter: function(callback, obj)
>> {
>> // The array length should be fixed, like in the native
>> implementation.
>> var l = this.length;
>> var res = [];
>>
>> for (var i=0; i<l; i++)
>> {
>> if (callback.call(obj, this[i], i, this)) {
>> res.push(this[i]);
>> }
>> }
>>
>> return res;
>> }
>> map: function(callback, obj)
>> {
>> // The array length should be fixed, like in the native
>> implementation.
>> var l = this.length;
>> var res = [];
>>
>> for (var i=0; i<l; i++) {
>> res.push(callback.call(obj, this[i], i, this));
>> }
>>
>> return res;
>> }
>> some: function(callback, obj)
>> {
>> // The array length should be fixed, like in the native
>> implementation.
>> var l = this.length;
>>
>> for (var i=0; i<l; i++)
>> {
>> if (callback.call(obj, this[i], i, this)) {
>> return true;
>> }
>> }
>>
>> return false;
>> }
>> every: function(callback, obj)
>> {
>> // The array length should be fixed, like in the native
>> implementation.
>> var l = this.length;
>>
>> for (var i=0; i<l; i++)
>> {
>> if (!callback.call(obj, this[i], i, this)) {
>> return false;
>> }
>> }
>>
>> return true;
>> }
>> [/DEBUG]
>>
>> The same happens when I try to split a string with the native JS
>> function String.split or even with the qooxdoo function
>> qx.util.StringSplit.split.
>> All these operations work fine in FF (3.0.13) but give me results like
>> the one above in IE (8.0.6). I'm using qooxdoo 0.8.2.
>>
>> Has anyone an idea why this is happening?
>>
>> Thanks in advance,
>>
>> Michael H.
>>
>> ------------------------------------------------------------------------------
>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>> 30-Day
>> trial. Simplify your report design, integration and deployment - and
>> focus on
>> what you do best, core application coding. Discover what's new with
>> Crystal Reports now. http://p.sf.net/sfu/bobj-july
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>>
>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day
> trial. Simplify your report design, integration and deployment - and focus
> on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
--
View this message in context:
http://n2.nabble.com/Problems-in-IE-converting-strings-to-arrays-and-splitting-strings-tp3502483p3507969.html
Sent from the qooxdoo mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel