Believe it or not, i'm still struggling with 1.11 because of crazy
dave nested sortables script.
I cant get that thing to work on 1.2. If i did, i'd migrate the whole
codebase to 1.2. Actually i migrated the thing on a separate branch to
1.2, but without the nested sortables.

Anyhow, the json is this:

[{"frname":"RISA Assessment Online Toolkit","frval":"1"}]
[{"frname":"Text (255 characters)","frval":"1"},{"frname":"Long Text
(more than 255 characters)","frval":"2"},{"frname":"Rich Text
(html)","frval":"3"},{"frname":"Dropdown (select box)","frval":"4"},
{"frname":"Number","frval":"5"},{"frname":"Currency","frval":"6"},
{"frname":"Date","frval":"7"},{"frname":"File (any type)","frval":"8"},
{"frname":"Image (JPG, PNG, GIF)","frval":"9"},{"frname":"Document
(Word, Excel, PowerPoint, PDF)","frval":"10"},{"frname":"Yes / No
(choice)","frval":"11"},{"frname":"Header","frval":"12"},
{"frname":"Lookup from another List","frval":"14"},{"frname":"SQL
Lookup","frval":"15"},{"frname":"Binded List","frval":"16"},
{"frname":"Multi update field","frval":"20"}]

(so the function is getting called twice with those 2 separate json
strings)
And the function that parses it:
http://www.pastie.org/411554

I've included a fraction of the code, since the whole thing is huge,
but the error happens there...
You can see the commented part, which is what works in FF, but not in
IE.
The json output is from the console.log statement in the source code.

On Mar 6, 1:46 pm, ibolmo <[email protected]> wrote:
> Never use for (... in ...) on non literal objects ( == {})
>
> :)
>
> Why are you still using 1.11? hehe
>
> Can you pastie (http://pastie.org/) your code? This isn't exactly the
> best place for that. :-\
>
> On Mar 6, 2:57 am, electronbender <[email protected]> wrote:
>
> > No, using mootools only (it's 1.11).
> > I know that .each is working since this particular .each is wrapped in
> > another .each, which is working...
>
> > On Mar 4, 6:24 pm, Thierry bela nanga <[email protected]> wrote:
>
> > > I think each might have been overriden,
> > > are you using another library (jQuery, etc ...) ?
>
> > > On Wed, Mar 4, 2009 at 6:18 PM, keif <[email protected]> wrote:
>
> > > > Do you have the full code?
>
> > > > I'd be interested in seeing what it'd say if you did:
> > > > jel.data.each(function(jop){
> > > >   alert(this);//or console.log in firebug to compare
> > > >  alert(jop);//or console.log in firebug to compare
> > > >   new Element('option',{'value':jop.frval}).appendText
> > > > (jop.frname).injectInside(frmel);
>
> > > > })
>
> > > > On Mar 3, 1:20 pm, electronbender <[email protected]> wrote:
> > > > > So i replaced that code with this:
> > > > >                                                                 var x;
> > > > >                                                                 for 
> > > > > (x in
> > > > jel.data){
>
> > > > new Element('option',{'value':jel.data[x].frval}).appendText
> > > > > (jel.data[x].frname).injectInside(frmel);
> > > > >                                                                 }
>
> > > > > And it works... But why does the .each method not work here?
>
> > > > > On Mar 3, 7:15 pm, electronbender <[email protected]> wrote:
>
> > > > > > I have this function:
> > > > > > jel.data.each(function(jop){
> > > > > >   new Element('option',{'value':jop.frval}).appendText
> > > > > > (jop.frname).injectInside(frmel);
>
> > > > > > })
>
> > > > > > Works fine in FF, but IE says that jop is undefined, and the error i
> > > > > > get is that jop.frval is null or not an object.
> > > > > > However, if i debug using Visual Studio, and add a watch to jel.data
> > > > > > you can clearly see that there are 15 elements in the array.
> > > > > > So why is this not working in IE?
>
> > > --
> > > fax : (+33) 08 26 51 94 51

Reply via email to