You said it’s an object,.

 
Casamayor: Ok I think I understand better. Will try that thanks

Draft: Hey all, I’ve also got a deferred question. If I get a promise by doing $.when and attached some deferred objects, is there any good way for me to attached extra conditions onto this promise after the fact?

Ilarraza: It looks like the promise doesn’t have a “when” method for me to attach more deferred objects

Casamayor: Felicien: pm? Just for a short question

Gerondale: Luun: what do you mean by attaching extra conditions after the fact? and by attaching deferred objects?

Tyrus: Sorry no time Casamayor, but asking in channel will get more eyes on to help everyone

Broks: Also http://www.htmlgoodies.com/beyond/javascript/making-promises-with-jquery-deferred.html is a nice resource bbiab

Casamayor: I get .getJSON..done is not function

Gerondale: Casamayor show your code

Casamayor: Here http://pastie.org/10397130

Gerondale: Casamayor you can’t access stuff from the inner getjson callback outside of it, only inside. why not put it inside?

Casamayor: Felicien just said to put it in the .done

Casamayor: But I just thought rather than trying to make the category variable available from the nested request I can just make all the DOM insertions right in there

Gerondale: You can, put the DOM insertion in the inner getjson callback, that should work

Casamayor: But I’ll really like to know for future reference. If I was to p*** category outside, how will that be

Casamayor: Like to make it available in the scope of the outter callback

Gerondale: It’s only available after the getjson request is completed

Gerondale: By that time, the outer function is already long finished

Kenley: Hello all im getting an additional undefined div with this code http://laravel.io/bin/529zJ I think it has to do with the for loop. I don’t know enough on what i can do here though

Casamayor: Ok thanks shoky , NoiseEee

Reif: Can anyone explain why this is giving me an extra blank div element? i think its in the for loop but i don’t know http://laravel.io/bin/529zJ

Bartosch: Some more info would be nice

Ragar: Its the object from uploader. I am using plupload and FilesAdded is an option you can add http://www.plupload.com/docs/Uploader#FilesAdded-event

Notto: Share an example of the data, then.

Duplesis: Stringify it and make a fiddle.

Hickie: So files is all the files i am uploading.

Fata: For in can cause some headaches which is why i asked.

Wylam: Umm so conceptually files is the object of all the files that are uploaded var i im ***uming is the iteration through the object, right? is that why you use Var I in.? Because you are iterating through an object? is there another way to iterate through an object. Like for reg for loops you can loop through an array, for example, upto the LENGTH-

Ducay: 1 of that array since arrays start at index 0. Does all that make sense because I just want to know if there are other ways to do what this for loop is doing

Matkin: For loops on arrays are kind of a bad idea too, but for in on objects can accidentally try to hit the prototype chain.

Cheung: Which is why you either avoid them or make sure you do them correctly. need to use hasOwnProperty or use a forEach against the array made by Object.keys

Schmitt: Http://jsfiddle.net/robertmaxrees/0qdhLmhq/ these are the two “smart” ways to enumerate over objects.

Mcgary: I got it to work! removed the for and just used plupload.each so now it looks like this: http://laravel.io/bin/kWroX I still don’t understand too much about js objects but getting there

Pelman: I was trying to help you understand heh

Redlin: Robertmaxrees yea lines 15-17 looks like .each right? the var in your above example lines 9-11 you’re checking if the object has a propname but isn’t propname a number, like an iteration.

Battenfield: You said it’s an object, not an array.