« first day (1299 days earlier)      last day (3666 days later) » 

1:08 PM
How to iterate over this string in jquery
{
"0":{
"VIP":"No",
"PACS Access Level":"",
"WatchList":"No",
"imagePath":"assets/images/member/4685827_1399383201431.jpg",

},
"1":{
"VIP":"No",
"PACS Access Level":"",
"WatchList":"No",
"imagePath":"assets/images/member/4685827_1399383201431.jpg",
"Vehicle Model":"",
"State Registered":"",

}
}
 
it isn't a string it is an object.
 
if it really is a string, you'd need to parse it as JSON first
 
no
 
after that, you got a plain JavaScript Object that you can iterate over
 
treat it as a object
 
1:11 PM
sorry
how to iterate over this object
 
it's an array of objects ...
 
for(var prop in obj){}
 
!!google iterate over JSON
 
@KarelG it's not
 
1:12 PM
its an object that acts like an array
 
it's an object containing objects as properties
 
true
missed the [ and ]
but if that string is from ajax ... then it should be an array of objects after parse()
 
even with [ ] it would be a corrupt javascript array
there are no associative arrays in js
 
@KarelG why?
JSON.parse('{"0":{"foo":"1"},"1":{"bar":"2"}}')
>> { '0': { foo: 1 }, '1': { bar: 2 }}
 
1:36 PM
dont you hate it when you do your job too well and make it so you have no work?!
 
do something else then
fe cleaning up the workroom ?
 
i will have to, but i was meant to be working on this bit of work for 2 weeks, just to find out just now, that the code id already written already handled the new functionality in its sleep (good generic code reuse) as long as the JSON response is as it should be
 
hehe denmark got blown up - bbc.co.uk/news/technology-27308555
 
lol
 
1:47 PM
@RyanKinal it's looking good!
 
Hooray! \o/
 
I cant wait to get my study setup and start working on things again!
 
Yeah... last night I skipped the usual gaming and went straight for creating.
Finished the CR API
Improved my home-recording skills
... it felt good :-)
 
anybody know what this ' [code for (code in win2byte)] ' fragment is doing? win2byte looks like var win2byte = { '\u20AC': '\x80', '\u201A': '\x82'}..
 
we moved house begining of march, have a wedding to save for, and a study to build from scrath (apperently im not allowed it in the lounge anymore - first house together)
so all other rooms have taken priority, haven't even got shelves
sigh
 
2:00 PM
Hey, you guys mind if I push a few JS help message from the PHP room to here?
Anyone from the regulars? @RyanKinal @rlemon?
 
why ?
 
@SecondRikudo I guess we would
 
Thanks
@dystroy Because it's OT on our room, and it annoys us
 
@SecondRikudo : if it's with alexstanese
then uhm no
he's been here several times
 
hehe it is
 
2:02 PM
It is :P
 
you can keep the Vamp
 
^--
 
then trash that
 
we've chased him away already
 
Does anybody here have experience with touch screen Windows devices?
 
2:03 PM
What kind?
I have a tablet
 
That should be fine
 
i've touched the windows behind me. Only the cleaning lady was startled
 
I am having an issue where tapping and dragging is scrolling when really I want it to draw on a canvas
Here is a fiddle jsfiddle.net/teC9t/2
(There is no canvas, but tap and drag is not logging anything there, just pulling the window down)
 
where is the code to listen for them?
MSPointerDown ??
why not touchstart and touchend
 
I was reading the MSPointerDown was the new catch-all for IE10+
I am not partial for it though
Just trying it
 
2:07 PM
uhm IE11+ yes
 
Ok well the behavior is the same either way
Actually no touchstart isn't working at all for me
 
/research
uhm, your fiddle
 
Yes?
 
document.addEventListener(... should be document. body.addEventListener(...
 
2:11 PM
check this (the bottom) and see if the flags can be active
 
@KarelG I changed it to document.body and touchstart still doesn't fire
Ok will check that
 
@rlemon i can buy that domain for a mere £305!!
 
@rlemon I don't see how that's helpful... The app I'm working on is built with jQuery and the plugin that I'm using (jSignature) is also a jQuery plugin
 
@Martin then why can you not use "touchstart" event?
$(el).on('touchsteart', myFunc)
 
Guys that's not my real problem.. The event is firing but the WRONG thing is happening
Ok let me put together another fiddle to show you the problem better..
 
2:17 PM
 
Typical JS answer: 10K only :(
 
It seems to be hard to make a sensible theme for a text editor. I find only stupid shiny unusable themes for atom.io...
Why make some things dark grey over slightly darker grey ? If I don't want to be able to read something, I don't put it in my code in the first place !
 
@Martin - I don't have a tablet running Win8, but the event fires just fine in my desktop IE11
 
poor leonard looks somewhat tired there
 
i'm tired too
 
2:25 PM
me three
 
@adeneo Yeah, it's not so much the event firing it's that when you press and drag it tries to scroll
 
but i might leave now. le work done /flips legs
 
@KarelG i have joinf again :P
:D
 
but new series of 24 tonight (any US people here tell me what happens i wil hunt you down and murder you!)
 
at least that's what happens for me and for the clients using our app
 
2:26 PM
joind*
 
hahahah
 
@Martin - can't really test that, but it doesn't scroll in IE11 (desktop), so I guess that's what supposed to happen on a tablet, you touch and drag, and the page scrolls, would be hard to navigate without it, and I'm not sure you can prevent it either.
There seems to be some suggestions here

https://coderwall.com/p/mfreca
 
@adeneo A bit of context might help understand the problem better.. I have a signature widget that is overlaid on top of the page (which obviously is long enough that the page can scroll). I want to be able to draw a signature on that popup without the page scrolling
It works great on other touch screens and browsers but on IE it scrolls instead
Yes I saw that article
 
        function *getNextSong(User){
              while( nextSong ){

                  nextSong = User.Playlist.findOne();
                  yield nextSong;
              }

              yield { song_id: null };
        }
how ugly is this @BenjaminGruenbaum ?
 
2:37 PM
the last yield is useless
 
user1596138
Well ST2 is certainly being weird today...
 
@AbhishekHingnikar Isn't nextSong undefined when the function is first called?
 
user1596138
 
user1596138
zalgo
 
user1596138
 
user1596138
2:39 PM
Oh it's getting worse!
 
A wild Missingno appears!
 
user1596138
Rebooted and still can't do anything without bleeding chars. Wut
 
@AbhishekHingnikar why the extra variable?
also, what's nextSong?
wait, isn't this always truthy?
Also, when you're done you'll be stuck
 
user1596138
@AbhishekHingnikar Working on that again?
 
@adeneo what device are you using
Can you get to developer tools on IE
 
2:46 PM
@Martin - The device I'm using is my desktop computer, the pointerdown event works in IE11 everywhere, but I can't replicate the scrolling issues on my desktop.
 
@rlemon he made his answer even worse now
 
@adeneo Ok perfect so I will try to make a workign example with jsignature for you
 
@BenjaminGruenbaum okay
well how do i handle promises and yield together ?
i mean db-calls in any node.js library are asynchronous
the way they should be :->
 
Ummm why is my iframe blank only in IE? jsbin.com/vaqivefu/2
 
@GNi33 I already downvoted and commented :)
 
2:53 PM
i like the generator pattern for things like song list and all
 
yeah, I just saw it
 
but how do i make them work with promises.. i mean
function GetSong(){
 /* Make an async Call and return a promise */
}
function *X( ){
     GetSong().then(function(lol){  yield lol; });;
}
just wont work :P
 
damn, I was about to explain to him why inline was bad.
then he deleted again
 
good morning gentlemen
 
@Shmiddty morning
 
@Shmiddty good afternoon
 
@adeneo ok here is a working example
Try to sign that and tell me if it scrolls
If you start by swiping vertically it doesn't work for me, but if you swipe horizontally it works
 
@phenomnomnominal doesn't underscore iterate over keys on an object by default?
 
3:13 PM
As it is, I don't think this question is useful (I'm waiting for comments before I vote to close). — dystroy 7 secs ago
 
the question he linked isn't confusing
It seems to me his question is: Explain to me this answer, because I don't get it.
 
sometimes I come back on some answers of mine and just want to upvote them
 
@FlorianMargaine you love yourself too much.
 
I can understand. Sometimes, I look at myself on the mirror and think "He deserves the d." before noticing this awesome dude is me.
2
 
3:24 PM
@BenjaminGruenbaum not intentionally ;-)
 
@dievardump it actually isn't. That is a window not a mirror. next time wave back asshole.
 
@dievardump so... do you give yourself the d?
 
@Benjamin Benjamin II your name shall be.
 
@FlorianMargaine I give myself too much things. Far too much.
 
best thing is @Benjamin pings them both :P
haha
 
3:28 PM
I'm lucky there aren't so many Florian
@dievardump let me guess, you only stop when it starts smoking?
 
@FlorianMargaine Depends what/who's smoking.
 
> In soviet re-union, original stuff copies china made
 
3:45 PM
How can I copy Array.prototype? I want to proxy some methods on it but i don't want it to affect the Array.prototype, rather i want to use the new prototype to extend something.
 
@Connor you can use classic inheritance, but you can't preserve the magic length
 
ok, thanks..
 
posted on May 07, 2014

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {} Big new project announcement coming soon!

 
@averroken Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
yes, have you seen my answer that worked, stackoverflow.com/questions/…

my answer worked, this can be upvoted by people
stackoverflow.com/questions/…
 
3:53 PM
@averroken The link is broken
 
* upvotes stackoverflow.com *
 
this is probably not broken
 
@copy @badgergirl @thiefmaster @OctavianDamiean @IvoWetzel @GNi33 @anyGermanSpeakerIMightHaveForgotten youtube.com/watch?v=zI3xPyGkS0o
6
 

« first day (1299 days earlier)      last day (3666 days later) »