« first day (1287 days earlier)      last day (3662 days later) » 

10:00 PM
@twiz They weed out the resume-shotgunners
and provide a bit of fun
 
@Connor "Damn"? Lose a bet?
 
@Zirak basically
dam stupid Microsoft b*stards
 
can you rollerblade while intoxicated?
 
Yes, for a few seconds.
 
I mean, legally
since you can't use your bike without getting a DUI
 
10:04 PM
'Murica
 
Godamnit @Zirak perl is so horrible.
 
@BHendricks 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.
 
Deep down, you love it.
 
10:13 PM
anyone have any experience using Node.js along with express 4.0?
 
Perl is Golfscript after RSA encryption.
 
Hello.
 
Is there a problem with this question? I fixed the ambiguity in an edit a long time ago...
 
@bjb568 It seems to be open at this moment
 
10:19 PM
@bjb568 i don't see any issues
 
Hum… I hate unexplained downvotes. It means I can't improve.
 
I rarely explain question downvotes.
 
I always do.
 
I found that askers don't react well to "your question is clear, but it's not useful for future readers".
 
When I see that, I think to myself about how I probably don't know enough to jump to that conclusion. I don't downvote just because it isn't useful.
 
10:25 PM
"find my typo among these 1000 lines of code" is not going to be useful. Nor clear.
 
CV: "Not enough info to diagnose problem". Downvote. Comment: "Could you narrow down which part of the code you need help with? Unfortunately it's quite difficult to tell what the problem is when there's so much code."
 
good approach; I might add something like that to the auto-commenter
 
10:39 PM
@zirak It looks like ws.onmessage = null cancels all onmessage events.
 
With the onmessage property, you can only assign one.
If you want better control, see addEventListener and removeEventListener
 
@Zirak do websockets support these?
 
Yep
 
@Zirak and I can use jquery's .on() instead?
 
Why would you do that
 
10:42 PM
Dunno, im just familiar with that, googled and saw a result saying ".on() vs addeventlistener, so i thought it's nearly the same lol
 
addEventListener is prettier.
 
thanks, nice.
 
@Zirak Did you check out my ratio code yet?
I had fun making it.
 
@user3123545 Then it's time to get familiar with native DOM.
 
10:42 PM
@user3123545 addEventListener doesn't need jQuery
 
@KendallFrey Not too much, sorry
 
and you won't get IE8 support in either case.
 
@JanDvorak I know it' doesnt, what I meant is, i thought that Jquery.on does the same job as addEventListener
 
@user3123545 It does. jQuery is just JS with shortcuts.
 
@user3123545 yep, except wrapped in a custom API
 
10:44 PM
@user3123545 Use the source, Luke.
 
@bjb568 plus an animation loop.
 
@Jan Oh, lord.
 
@Zirak Can't find what I am looking in the source you found, still reading though.
 
I referred to the jquery source.
Read it to know what on does. And still use addEventListener
Because if you do $(websocket) I'll hit you
2
 
10:48 PM
@Zirak With a giant $, I assume?
 
It would be good if you could link or show me an example of eventlistener used with websockets. Never used these.
 
!!tell user3123545 mdn addEventListener
 
!!tell user mdn addeventlistener
 
10:48 PM
damn, ninja'd
 
lol whats that !!tell command?
 
!!tell user3123545 help
 
!!tell user help tell
 
@user3123545 Information on interacting with me can be found at this page
@user tell: Redirect command result to user/message. /tell msg_id|usr_name cmdName [cmdArgs]
 
:P
 
10:50 PM
So somewhat like, el.addEventListener("onmessage", ... etc.. ?
 
OK, I better leave for today. It's night time anyways :-)
@user3123545 without on
 
Ah
ws.addEventListener("message", function(e) {
looks correct?
I assume i have to use it on the websocket object, correct me if I am wrong
 
correct
 
yeah. You won't want to declare the handler inline though if you want to use removetEventListener
 
what do you mean by handler inline?
 
10:53 PM
newbie alert! I'm learning basics of Javascript and currently studying functions. Do I understand correctly that the 'return' keyword simply stores the function value in memory for later usage?
 
@redshift No, you have no idea what you're talking about. console.log(a()) will log the return value that came out of running the a() function.
 
The second argument. You pass a function, and in your example you create the function on the spot. Instead, pass an existing function, so you could reference it later in removeEventListener
 
@redshift return terminates the function it is in
 
//For instance:
ws.addEventListener('message', handler);
function handler (e) {
     ...
}
@redshift "Function value"?
 
@zirak Ah
 
10:55 PM
@redshift Wait, were you the whom I argued with several months ago about how "use strict" doesn't really cut down on debugging time?
 
ws.addEventListener('message', function handler (e) {
     ...
}); //Better
 
@bjb568 And how will you remove that event listener now?
 
!!tell user3123545 mdn removeEventListener
 
so something like: var timesTwo = function(number) {
return number * 2;
}; is the 'return' merely storying the value of this function for later usage?
 
@Zirak removeEventListener(handler)?
 
@bjb568 named functions in expressions are... undesired
 
@Jan Why?
 
@bjb568 handler is only visible inside its scope, not outside, since it's a function expression.
 
@redshift no. The = is.
 
@Zirak nope! no idea what you are talking about
 
10:57 PM
@bjb568 it doesn't quite work the same as a function statement
 
http://oscargodson.com/posts/unmasking-jsonp.html i cannot understand a few parts of this code.
1. the lines of code in the function window[generatedFunction] .
2. window.JSONP = JSONP near the last line.
how are they executed?
 
@Jan Oh, just tested it. It doesn't work.
 
23
Q: JavaScript function order: why does it matter?

Chris TolworthyOriginal Question: JSHint complains when my JavaScript calls a function that is defined further down the page than the call to it. However, my page is for a game, and no functions are called until the whole thing has downloaded. So why does the order functions appear in my code matter? EDIT: I ...

 
well then...if i do var newNumber = timesTwo(4);
console.log(newNumber); ...how does 'return' not store it for use in this case?
perhaps im confusing 'return' as a variable
 
What's your actual question? What does the return statement translate to in Assembly? How it looks like in memory?
Or what it conceptually does?
 
10:59 PM
@redshift return passes data out of a function... roughly speaking
 
@JanDvorak ok this make ssense
 
what it conceptually does.
 
passes, not stores it in memory
 
It has to store it somewhere, but why do you care where? It could be on the heap, the stack...but it's all memory at the end.
 
@zirak How can I link the handler? it will require the paramater, Uncaught ReferenceError: e is not defined
 
11:01 PM
all good, thanks
 
@shortCircuit The first point is bracket notation: developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/… The second is exposing the JSONP function to the global scope.
@user3123545 "Link the handler"? What?
 
@Zirak ... or not, if the return value is discarded immediately anyways
 
like addEventListener("message", handler
handler = the fucntion, no need to add () to it'?
 
@JanDvorak Or maybe your function isn't a function at all, since it got inlined.
@user3123545 'course not, you're not calling the function
 
Damn I i lake so many basics in javascript
kk it works
 
11:06 PM
Awesome.
 
But
event listener isn't getting removed lol
I think
 
yeah, check the removeEventListener docs
 
alright
oh stupid me
 
@Origineil 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.
 
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. — bjb568 1 min ago
0
A: Define Javascript Variable With Contents of URL

sphanleyYou should use Javascript to make an ajax request to that URL and it will return the information you want in a format you specify, usually JSON. Depending on what Javascript libraries you are/aren't using, there's different ways you could do that -- probably the most common would be to use jQuery...

 
11:21 PM
newbie alert! Is this code OK?
var nameString = function (name) {
return("Hi, I am" + " " + name);
};
console.log(nameString("Nick"));
 
!!tell redshift format
Define "ok"
 
@redshift Format your code - hit Ctrl+K before sending and see the faq
 
or is it better to write it as: return "Hi, I am" + " " + name; without parentheses?
 
You have a useless string concat (string literal concated by a space? Why not have the space already in the literal?), and it's not so common to surround the return value in parentheses.
 
var nameString = function (name) {
return("Hi, I am" + " " + name);
};
console.log(nameString("Nick"));
@Zirak yea i know about the concat, but concerne about parentheses for now, thanks.
 
11:23 PM
They don't matter.
 
function nameString(name) {
    return('Hi, I am ' + name);
};
console.log(nameString('Nick'));
 
@Loktar, @rlemon, @SomeGuy youtube.com/watch?v=LBilT83Uq4A
drool
 
SyntaxError: missing ; before statement -> jquery-2.1.0.js:336 Is this an error in jquery file? Or can error from somewhere else still show up as if there's error in jquery.js?
 
If there's an eval or something of the likes, it'll show up as originating from there. Other than that, it's an error in that file.
@rlemon Did we just both get to FFXV at the same time?
So romantic
 
11:30 PM
@user1377392 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.
 
Also, they're planning a Witcher 3.
Or executing. Something like that.
@rlemon durr, I'm an idiot
Apparently, pasting my link doesn't paste yours.,
And yeah, I've seen it
 
Rule 43 , if it exists there is an API for it
 
@BenjaminGruenbaum except for Google Plus comment system
 
Google Plus does no more than suck, so it doesn't exist.
 
exit
 
11:57 PM
Coworker submits a pull request:
 
Does anyone know of a good node.js hosting / cloud service?
Amazon, Google, Rackspace?
 
Heroku, Nodejitsu are both nice
ec2 if you don't mind doing server admin
 

« first day (1287 days earlier)      last day (3662 days later) »