« first day (1228 days earlier)      last day (3727 days later) » 

9:00 AM
@MoshMage look up "event delegation in jQuery"
 
3 mins ago, by Florian Margaine
@Loclip what you want to type in google is: "jquery event delegation"
ninja'd.
 
hey please guys have a look at my question stackoverflow.com/questions/22008669/…
 
@FlorianMargaine it worked, thank you :)
 
i used playAudio("/audio/a.wav");
<li onclick="gallery.goToPage(1);playAudio("/audio/a.wav");"></li> but it is not working
 
9:02 AM
why is it not working ?
do you have an error?
 
playAudio("/audio/a.wav"); method inside the html file
no any erro
 
@AdeshPandey I don't know three and you didn't make a fiddle but you probably should draw only after the images have been loaded
 
ok @dystroy anybody else here who uses three.js ?
 
@square have you added a console.log in the playAudio function to see if it's run?
 
@JanDvorak and @FlorianMargaine although that delegation technique thingy is what you are supposed to do (if you code such a way) the @Loclip doesn't actually need that. But I get your drift.
(yes, I went and read and wept)
 
9:03 AM
*wept?
 
that!
 
@MoshMage anytime you use ajax to include new elements, and want some handlers on these elements, you need to use event delegation
other times, it's also way better
 
(i liked how you "other times" it xD)
 
if you have a big table, and want an event handler on every td. You can simply add one event handler on the whole table instead of adding one handler on every td.
 
^ that.
Its the sensible / sane way to do it.
 
9:05 AM
So, is there a disadvantage of using this.data(key, val) over jQuery.data(this, key, val) when adding data collection? As part of jQuery.fn.someExtension
 
it's the same
well, if this is a jquery object, that is.
 
@FlorianMargaine not technically "need". you could have an event handler attacher that is called from the ajax success.
 
(it often isn't.)
@JanDvorak I guess.
 
now. Can anyone tell me why $('.someclass').on('touchmove',function(event) { is not working ? [as in: Am I failing at some word or something?]
 
@MoshMage no obvious reason
 
9:06 AM
@MoshMage Depends on device.
 
@MoshMage because these elements don't exist yet?
 
@JanDvorak elements exist, I think, but I'll double-check and will check the "depends on device" as well
yes, element exists because they're in the dom from the start, they're not added
 
Another one question instead of $(#features .div") how I can do this $(this " .div")?
I want to get the .div of this
 
@Loclip no. That would be a syntax error
 
do you want the direct children? $('#id > div') gives you the direct div children of #id
 
9:11 AM
maybe $(this).find ("div")
 
$("div", this)
 
The case is that if I use jQuery.data(this, "some_name", ...) the resulting data record will never be the same. $(".some_class").some_addition() result in new instance – as: $.data(this, "some_name") always return false.
 
can u check this
 
@Loclip $('.div', this). The second argument of $ is the context in which to find the element of the 1st argument
 
9:12 AM
Case/issue.
*new instance each time.
 
ok, problem was that I was using the wrong variable inside, event.touchTarget[] doesn't exist
 
@JanDvorak @FlorianMargaine yeah it working great... @C5H8NNaO4 answer also works.
 
@MoshMage iirc, jQuery patches the touch events
 
help me jsfiddle.net/somendra/cLL8f Plaaudio('audio/a.wav' ) is not working
 
9:20 AM
@square: Uncaught SyntaxError: Unexpected token ]
 
@mikedidthis yep, i made a console.debug(event) and caught the thing i needed :)
 
@square: Check your console, in the web browser. Ctrl+Shift+J console on a few of them ...
 
ok
@user13500 <div id="wrapper"></div>
<ul id="nav">
<li id="prev" onclick="gallery.prev()">-</li>
<li class="selected" onclick="gallery.goToPage(0);playAudio("/audio/a.wav");"></li>
<li
i used swipeview.js
i want each swipe sound
my playaudio fun is working
when i am calling use of button action but when i have added in <li class="selected" onclick="gallery.goToPage(0);playAudio("/audio/a.wav");"></li>
it is not working
any other way to call
playAudio("/audio/a.wav")
when user swipe
this way is correct or not <li class="selected" onclick="gallery.goToPage(0);playAudio("/audio/a.wav");"></li>
@user13500
are u getting my point
@FlorianMargaine do u hav any idea to solve this
 
@RUJordan The person who's making Nothing to Hide!
 
@SomeGuy RUJordan is afk: bed
 
9:29 AM
@dystroy Huzzah!
 
@square: First thing is to not use unescaped double quotes inside your onclick
 
!!s/do.*de //
 
@JanDvorak @square: First thing is to not use unescaped your onclick (source)
 
!!s/un.*ur //
 
@JanDvorak @JanDvorak @square: First thing is to not use onclick (source) (source)
 
9:39 AM
then
waht is correct way to call
 
"playAudio('/audio/a.wav');" or 'playAudio("/audio/a.wav");' or "playAudio(\"/audio/a.wav\");"
 
@JanDvorak I love what you guys did with that bot. I love it so much that I've pondered reading the code just for cracks
 
@user13500
then also not working
 
@square: And then, have you fixed the syntax error? var gallery, el, ];
 
9:53 AM
@square
 
yes
 
What's the right closing reason for this one ?
0
Q: How is Javascript (js) encrypted and decrypted?

user2336473I am learning javascript by studying many file .js but I can't understand anything. Many of them start with: (function(){var aa=encodeURIComponent,f=window,ba=setTimeout,n=Math,ea=RegExp;function fa(a,b){return a.name=b}function Pc(a,b){return a.href=b}... I think this is one way to encrypt th...

 
code format? :X
> plz
studying by reading things you don't understand? idk
 
10:13 AM
lol, @Mosho you normally do study things by reading things you don't understand :p
 
you read explanations of things you don't understand
 
fair point
 
more often than conjure them yourself
brb learning german by reading german from scratch
 
ok, ok already; I said you had a fair point x)
 
@user13500 i am working in phonegap with ide
i checked in console there is no error
 
10:30 AM
@RyanKinal What happened about Gamora?
 
@user13500 i want to call PlayAudio(src) </li>
<li onclick="gallery.goToPage(1);playAudio('/audio/b.wav');"></li>
how to call
like this it is not working
but function onDeviceReady() {
// playAudio('/audio/a.wav');
}
playAudio function is working. problem is how to call when "gallery.goToPage(1) come
 
I'm going crazy... jQuery.keydown is triggered constantly when you long press a key? See api.jquery.com/keydown
 
@RayZ 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.
 
Any one know of any way to detect the first time a key is pressed?
I need to know that the key was initially pressed on my browser tab
 
I can't get this song out of my head
 
10:39 AM
wrong link... I meant see my example here jsfiddle.net/nTT47
 
!!youtube rammstein pussy
 
@user13500 i want to call PlayAudio(src) </li>
<li onclick="gallery.goToPage(1);playAudio('/audio/b.wav');"></li>
how to call
like this it is not working
but function onDeviceReady() {
// playAudio('/audio/a.wav');
}
playAudio function is working. problem is how to call when "gallery.goToPage(1) come.this is my code pls help
 
halp
 
@AdamLynch watcch for keyups and remember the state, then fire your own events?
 
10:41 AM
@JanDvorak I do kinda. I'll have to explain my situation a little... I detect keydown and keyup right now. Any time a keydown is triggered (let's call it key A), I add it to a currentlyPressedKeys array. It is removed on keyup. If another key (B) is pressed while key A is pressed it will be added key A's currentlyPressedKeys entry as another key pressed while keyA was pressed. Then on keyup for key A, nothing will happen if another key was pressed during the time.
The problem is that's built on the assumption that keydown is only triggered on first key down
So if I have a shortcut for the "2" key and a user on mac pressed alt+2 to change tab , then releases the alt key before the 2 key... first keydown is triggered for 2 then keyup and my code is fooled into thinking 2 was pressed on its own in my tab
I need to detect first key down so I know it was done in my tab
 
@harish 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.
 
10:56 AM
Good evening guys
JS noob here.
I've got some questions on jQuery.ajax() method.
So far, i understand that it returns a jqxhr object.
But after that, how do we grab the data returned from the server?
 
var jqxhr = $.ajax( "example.php" )
  .done(function(data) {
    console.log( "result:",data );
  })
  .fail(function() {
    alert( "error" );
  })
  .always(function() {
    alert( "complete" );
  });
If you want to use the returned object, the simplest solution is to to use done
 
Ahh
So we need to set an event handler first?
Thanks!
And what is data? Object or string?
 
Depends
 
If my server sends a json response, what would it be?
 
on the settings, on the mime type of the response, mainly. For example if the server properly answers with some JSON, data will be a js object (or array), the equivalent of JSON.parse(responseText)
 
11:13 AM
Might be the easiest question of the day :
0
Q: Jquery :How did i get The number of images

LinmiI have a question about this, my "images" have aaa.jpg ,bbb.jpg",ccc.jpg" three images. What code did i use can get the "images" have three image? var images = [ "aaa.jpg", "bbb.jpg", "ccc.jpg" ];

Does that sound doge ?
Right!!! very thank you! — Linmi 33 secs ago
 
should I avoid using style in HTML tags?
 
@Mosho yes
 
I'm parsing a custom style, specified in a JSON object
 
This new machine is a BEAST!
 
completely random, like <RowHeight>2,54,65,4</RowHeight>
I'm using a templating engine
@JanDvorak what would be a better option?
 
11:23 AM
@Mosho CSS
 
the style is determined dynamically
 
then styles
 
I guess I could have a function that adds to a CSS and returns some random class name
by styles you mean using style in the tag?
 
do you have multiple elements with the same style?
 
not necessarily
and if I do, there's a <style> tag
for which I will indeed use a CSS
but otherwise style is defined on the go and for the element it's defined in only
 
11:30 AM
!!weather Seattle
 
@kwak Seattle: 39.0379F (3.91C, 277.06K), mist
 
!!weather Helsinki
 
@kwak Helsinki: 2C (275.15K), broken clouds
 
!!weather moon
 
@Mosho Moon: 29.6419F (-1.3101C, 271.84K), overcast clouds
 
11:33 AM
damn
 
!!weather goa
 
@RahulDesai Goa: 24.258C (297.408K), overcast clouds
 
what do I use to create a grid with totally custom cell height and width?
pure and bootstrap don't see to have that
 
@Mosho CSS
I heard a rumour that it's actually possible to create an entire website without using any libraries! I know, must be bullshit...
 
11:49 AM
it's also possible to create it in binary
and I can't use CSS in this specific case
 
From a job description by people knowing Dart : " Dart, Google's answer to Node.js"
Did Dart evolve to be something more than just a language compiling to javascript ? How does it "answer" Node.js ?
Who knows Dart here ?
 
@monners I mean, I can, it's just not very convenient
@dystroy I think it's independent of JS and only compiles to it for browser support
don't know about answering node
 
@Guru 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.
 
Can anyone see why this solution: stackoverflow.com/a/7731442/1419515 isn't working with my custom map type? jsfiddle.net/Eb5mC/1 Any help would be much appreciated!
 
12:12 PM
@Banti 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.
 
in PhoneGap Framework , 12 secs ago, by Benjamin Gruenbaum
Wait, your title says "learn from w3schools.com".
-_-'
 
@BenjaminGruenbaum No worry, it's only for biggners. Do you know any biggner ?
 
I'm pretty sure okok is a biggner.
 
So... no worry
 
12:17 PM
Don't mute me :D
 
Don't you just love how an answer's score is inversely proportional to its length?
BTW @Miszy :)
 
@Qantas94Heavy unfortunately, the lower limit is 15 characters
 
@JanDvorak: .
 
12:20 PM
though, you might cheat that by using whitespace.
 
@Qantas94Heavy being concise is being clear. Sometimes.
 
@dystroy often it correlates heavily with leaving out information
 
Well... hard to give a rule here. Bad short answers are also more downvoted than bad long answers. In both cases it's easier to conclude and vote.
 
!!should I implement it in angularjs or winjs
 
@AbhishekHingnikar winjs
 
12:29 PM
!!are you certain ?
 
@AbhishekHingnikar All signs point to yes
 
lol... try again
 
!!can i blame you if it doesn't works out ?
she chooses to stay silent on this ;-)
 
@BenjaminGruenbaum Hahaha
 
She's looking for a bad old technology to suggest. Did you think about coding it in logo instead ?
!!should AbhishekHingnikar implement it in logo instead ?
 
12:31 PM
@dystroy Impossible
 
Too bad
 
@dystroy no its a question of good or bad
WinJS => Less building time, Hyperoptimized animations etc
Angular => Mediocre building time (porting all the animations will take friken time), but once done can deploy anywhere. So its a question of million pounds zillion dollars and trillion possibilities.
I can alternatively wrap winjs with angularjs
 
@square: Add a function that do what you want and use addEventListener with bind.
 
@dystroy Logo was fun
 
@SomeGuy now make a web app with it
 
12:34 PM
I can't do that, but I might be able to make it write "web app"!
 
1:22 PM
dawgs
can I put an angular app inside an angular app
 
 
:P
seriously though
I have an app that generates apps
and I want to put that app in the app so I can app while I app
so I put that app in an iframe
or whatever
but the app generator gets something from a server I want to use in the generated app
although I guess I could ask for it in the iframe
as well
is this even possible
 
You just wrinkled my brain
 
@Kippie Your brain was already wrinkled
 
@KendallFrey That's racist!
 
1:34 PM
o_O
 
Someone's brain is insufficiently wrinkled
 
why hello friends.
 
Yay. I'm 71.4% into solving Project Euler problem #14. Are our solutions intended to take half a day to complete, or is it that I just suck at Haskell?
 
Maybe both!
 
1:50 PM
OK... once it's done computing in a few hours, I'm going to try using a map rather than a list.
 
is it just me or is the documentation for JS MVC a bit flakey?
 
@JanDvorak I did one in Haskell too and it takes a couple of seconds to run. So the latter
 
@copy may I send you my code for criticism?
 
Sure, but don't expect an explanation for the speed
 
Also, does your code, by any chance, take up 1G of memory?
I'll try something more, then I'll ping you. Thanks
 
1:53 PM
Nope, stays at around 80MB while running
 
Quick question: do lists in Haskell take linear time to access by index?
 
Yes
 
that could be the cause. Maybe I'd be better off without caching altogether. I'll try that too.
 
hmm... I'm a bit lost in this documentation: v3.javascriptmvc.com/docs/…
 

« first day (1228 days earlier)      last day (3727 days later) »