« first day (911 days earlier)      last day (4262 days later) » 

00:02
@Loktar, yeah!
Dude..
Gannicus?!
Devastating aye
wtf Why did they let Agron and Nasir live/!
Id rather have seen Gannicus live
When it was Spartacus going after Crassus and Gannicus after Caesar, I was like fuck yeah, they're going to dominate
and then
nope
And they didn't just kill him, they fucking crucified him
yeah :?
He was my fav sucks.
where do you get your ep's from?
I want to dl it so I can watch it again.
cool ty
Did you read this?
@phenomnomnominal nope ty
Ill check it out now
With the 1channel XBMC addon is awesome
any tips on good torrent apps?
I used to use utorrent, heard its ass now
00:14
nvm
Braces should only appear on the left if ()\n{, not on the right
user1125394
s/\n/
00:32
@Loktar, I use put.io
Its a pay service
But you download the torrents on the server then it's just a normal HTTP download
Silly New Zealand and torrenting being illegal
thats lame
torrents can be used legally Blizzard uses it all the time
oh well bleh Im a pansy anyway Ill just wait for the dvd release
its currently on OnDemand on cable right now anyway
Well they're not illegal, they just monitor for torrentlike traffic
Hello guys
ah crazy
And then they can check your shit out
00:34
Could I ask a thing?
New Zealand just constantly caves to pressure from the US...
@Sergio you just did
You may ask one more thing though.
ok man I would like to create a number of 8000 xmlhttprequest in a javascript html. But I can't set cookie and the open doesn't work
InvalidAccessError: A parameter or an operation is not supported by the underlying object
[Interrompi per questo errore]

xmlhttp.open("POST","http://myurl/test",false);
I didn't create the loop but simply the request
$("#id").val().length to count the characters in a phone field... How can I get it to ignore the following, "(" and ")" and "_" and "spaces" jQuery mask is causing problems. I need to enable a button only after 10 digits are entered. It's giving me a count of 14 every time :(
Ooo... Found this .replace(/\D/g,"").length will try it
00:54
How much wind could a windbreaker break if a windbreaker could break wind?
Vin
Vin
Can someone please tell me why this 3-liner isn;t working jsfiddle.net/85dDH Many thanks in advance
SORRY I mean't this one
I worked out the problem - Just ignore me!!!!!
Okay!!!
01:13
I wonder if there's a great JSP / Servlet based CMS out there
01:23
wow wtf
a ton of people flagged @darkyen
lol I hit invalid, sheesh
What did he say?
something about being an indian and he will work for the lowest wages if someone will provide citizenship
@darkyen test
Mostly, when you see programmers, they aren’t doing anything. One of the attractive things about programmers is that you cannot tell whether or not they are working simply by looking at them. Very often they’re sitting there seemingly drinking coffee and gossiping, or just staring into space. What the programmer is trying to do is get a handle on all the individual and unrelated ideas that are scampering around in his head. [Charles M. Strauss]
@rlemon any way you remember me the website where you get all these fun shirts?
01:36
Geez, why is that flagworthy
idk, he didnt post it in here
so was probably flagged by people that didnt know him
@SOChatBot pfft.
01:54
Interesting chat flag. :)
Haha who would even flag that
at least five people
what is the average or most common annual wage in India?
It's up to 7 now. All on that pinned message. lol
People are silly
02:02
People need to get a sense of humor, if you don't have one, the internet is the wrong place for you.
@phenomnomnominal Just curious, but using just base JS and not jQuery, am I really cripplin my cross-browser capabilities if I don't know the exact differences?
Or is it really only for doing really high-tech stuff that you need to worry about cross-browser issues
Vin
Vin
Can anyone here please tell me how to check if method is a 'return null'?
There are a lot of inconsistencies, but they're "mainly" in older browsers
@XCritics hint: old IE lacks the XMLHttpRequest class, and the replacement is activeX
The only jQuery I'm currently using is $.ajax
@XCritics Yeah, if you're doing a lot of AJAX stuff, it's just easier to use jQuery
02:07
Hey. Does anyone have a moment? I'm making a small game and need someone to test if my server for it is working. braddodi.com/test
@XCritics old IE also lacks JSON, addEventListener (this one sucks hard), IE7 doesn't have querySelectorAll...
@JanDvorak all IE lacks addEventListener??
@JoeyMorani dude, that's a cool game
I'm not even sure if IE9 lacks addEventListener but I'm pretty sure IE8 does
What's the replacement?
02:09
@CCInc Thanks :)
Vin
Vin
ANyone/
Don't tell me that was made in JS?
Yeah, made in JS and using webgl
@XCritics attachHandler; also, there's no polyfill possible for addEventListener
Vin
Vin
Can anyone please recommend an easy and well documented js/jquery cookies framework/
02:10
@JoeyMorani wow
Vin
Vin
?
@JoeyMorani it wants to steal my mouse. How do I get it back?
Escape
should give it back
@JanDvorak Easier to just use jQuery than?
@JoeyMorani How'd you do the networking?
02:12
@XCritics unless you don't care for IE
@XCritics, yep way easier
@CCInc websockets i presume
aaaand it crashed
:P
Yeah, websockets
@XCritics I've heard jQuery animations are inefficient
@XCritics, just use CSS for animations, unless you need old browsers
@phenomnomnominal if I firmly believe I have a good idea of controlling the dom, should I just use jQuery?
02:13
Moral of the story is, if you need old browsers, use jQuery. If not, then try to not
I was just doing it for learning
Oh ok
I'll just stick with base JS for now
and shun IE?
Yeah, whoever uses IE should be shot anyways
Well that's unfortunately not realistic
You also don't want to waste your time reinventing the wheel
what about IE10? IE10 sucks less
02:14
Alright, jQuery it is!
Just don't let us tell you
Make up your own decision
or try one of the alternative frameworks or libraries
It's a large library, so if you're only using it for AJAX, maybe theres something else you can use
Well every time I say I'll just use vanilla you guys give me more reasons not to :P
there are some really tiny libraries out there
02:15
I like jQuery, it's easier and fun to write, I was just doing vanilla for learning purposes, but I'm pretty sure I have the hang of it now so I think I'm just making things harder on myself by refusing not to (like writing node without express)
you'll also need vanilla for the things IE doesn't support
because jQuery doesn't either
Seriously, why does IE even exist
@XCritics I'm doing the same thing atm. I'm only using pure JS but thinking that things could be done easier and quicker using jQuery.
@JoeyMorani are you aware of Node#querySelectorAll?
No
What's that?
Oh
02:18
HTMLDocument#querySelectorAll; sorry
Yeah, looked it up. Why do you ask? :)
What are the tasks jQuery helps you with?
Functions get hoisted to the top right? So I don't need to worry about order (other than readability) but var = function doesn't right?
More like animation, moving elements around, etc. Also finding that most libraries use jQuery so I may end up having to use it.
@XCritics right; please don't overwrite hoisted functions, though
02:23
Can you explain what you mean by that?
var f=null; function f(){}; f()
what is the expected behavior?
the function,maybe :P
!!> var f=null; function f(){}; f()
@JanDvorak "TypeError: f is not a function"
hoisting means they aren't really where they are
functions don't reinstate themselves where they're declared
function declarations are applied when their defining scope is entered
so, please don't overwrite hoisted functions. You'll end up confused.
02:27
Oh ok :)
im so lost with my js script :(
    document.getElementsByAttribute('data-id').forEach(function(o) {
    	o.addEventListener('click', function(e) {
    		e.preventDefault();
    		deleteNews();
    	});
    });
I have one last question, I'm loading multiple a-links and I need a way to identify them separately, so I did data-id='#{info._id}', and was going to go getElementsByAttribute, but then I find that I guess that is a jQuery method, how might I assign event listeners to all of them, this was my attempt:
$("[data-id]").on("click", function(e){...})
What might be the vanilla way to do things?
with delegation: $(document).on("click", "[data-id]", function(){})
The vanilla way, shunning IE, seems to be what you've written, except nodeLists don't have a forEach method
[].forEach.call(document.getElementsByAttribute('data-id'), function(){...})
Says I cannot use getElementsByAttribute at the bottom there
what causes a function to be considered undefined if the function you call is not inside any other function ? its not making any sense why i get the error
@Dave any chance it gets overwritten? fiddle please
any chance you're calling it before it gets defined?
no i use windows onload
window*
ill check for over writes
02:35
any chance it's shadowed by a local variable?
Uncaught TypeError: Object #<HTMLDocument> has no method 'getElementsByAttribute' I guess I cannot use that
@XCritics QSA, then?
@XCritics perhaps you should assign a class?
After all, access by class is faster than access by attribute
i got it
was because of browser cache
hadn't updated
02:38
I guess I could do class, but I like to save that specifically for styling
is there a way to turn cache off in chrome during development
I hate stale caches
CTRL+F5 is the closest you can get
or download fiddler2
ok thanks will take a look
@JanDvorak
	var element = document.getElementsByName('deleteNews');
	for(var i = 0; i < element.length; i += 1) {
		element[i].addEventListener('click', function(e)  {
			markAsReadDatabase(this.getAttribute('data-value'));
			e.preventDefault();
		});
	}
Worked for me
way to go; still, consider using a class
02:42
How come class?
!!/tell xc mdn getElementsByClassName
I can't see any name in your fiddle
That was first attempt, worked on my actual project, but why do you suggest class over name?
@JanDvorak jsfiddle.net/Jzyry/2 good?
@XCritics do you have duplicate names?
If it's a radio group, chances are you'll like to add another one
02:50
jsfiddle.net/Jzyry/2 this is what I have now
cache document.getElementsByClassName('1')
What might that do
var ls=document.getElementsByClassName('1'); for(i=0; i<ls.length; i++){...
improves performance and DRYness
What should I wrap all this in, or just leave it outside of any functions/
jsfiddle wraps that with onload
or just place that after the elements you're accessing (that is, at the end of body)
02:53
gist.github.com/Gacnt/9234606d2e83c6c6df70 how bad is my code, give it to me straight
Why is document.getElementById('addNews'). etc. outside onload?
Um... I just figured onload was for things that didn't execute on page load
wrong. onload is for things that should execute when the page is fully loaded.
If that script is in the head, the elements you're trying to access don't exist yet
would it be cache, then the var?
02:56
like I can't go, var ls = cache document.gpmgomoeg
cache is not a keyword. It's a concept.
oh, so local storage or what?
I meant, caching in a variable
like I've demonstrated
ooh
Sorry, I understand now
since you're using jQuery, $(document).ready(...) is the event when you should execute most of your event attaching. window.onload happens a bit later
02:59
Can't I shorten that to just $(function(){})?
then there's the DOMContentLoaded native event that IE doesn't support
lol are we still talking about how IE supports nothign
$(function(){}) that shortcut is valid
@CCInc since XCritics wants to use the native DOM API, yes.
lol
For learning purposes, make me look like a dick head :P
03:00
While we're at it, IE doesn't support .addEventListener ;p
@JanDvorak can I pass this down through a function?
each execution context has its own this, but there's nothing wrong with var el = this
rowDiv.style.borderBottom = '1px solid lightgrey';
rowDiv.style.marginBottom = '1%';
rowDiv.style.paddingTop = '1%';
^ consider using a CSS stylesheet instead
titleSpan.className = 'span9';
titleSpan.innerHTML = '<h2>' + data.success.title + '</h2>';
^ you're mixing HTML interpolation with element creation, and you're doing it a way that provokes injection attacks.
How might I do that better?
03:07
'<p class=\'muted credit\'> ' -- alternating quote types helps you reduce the amount of escaping neccessary
concerning that innerHTML, you could create an h2 separately, and set its textContent. If you want to be extra-clean, create a text node and append it to the h2.
document.getElementById(id).appendChild(titleSpan);
document.getElementById(id).appendChild(timeSpan);
document.getElementById(id).appendChild(bodySpan);
^ cache document.getElementById(id). If you want to be extra-clean, create a documentFragment.
You could cache the various document.getElementById('newsform')s in the global scope (more exactly, at the beginning of the ready callback)
var eNewsform = document.getElementById("newsform")
there's not much point in doing preventDefault for <a href="#">
I don't want it to shoot to the top of the page if I click it near the bottom
document.getElementsByTag('body')[0].removeChild(document.getElementsByClassNam‌​e(id)); looks like it should work just fine?
use document.body instead of document.getElementsByTag('body')[0]
I don't think removeChild accepts a collection
Also, you're assuming that element's parent is body. Please don't.
var eId = document.getElementsByClassNam‌​e(id)[0]; eId.parent.removeChild(eId)
03:22
hmm, just when I think I have a clue :P
stupidly, the fastest way to empty an element is to remove each child in turn.
var fc;while(fc=e.firstChild) e.removeChild(fc)
eId.parentNode; sorry
Psh, you don't have to apologize to me! Thanks that worked great.
there's also eId.parentElement; I haven't checked which one is better
03:37
Tabs are better than spaces
04:05
Quick question i have a timeout which i assigned to an object like this:

Timer[2] = setTimeout(function() {} // etc

Now if i want to clear the timeout i want to check Timer[2] is a timeout and if so then clear it.
is it wise doing it this way =/
clearTimeout(Timer[2])
well i have:

		if(typeof timers[2] !== "undefined"){
			clearTimeout(timers[2]);
		}
		if(typeof timers[3] !== "undefined"){
			clearTimeout(timers[3]);
		}
but both occur even tho timers[3] was never designated to a timeout
timers[3] == false at the moment
but that still counts as defined
what should happen if there are more than four timers?
it will add timers[4]
will you clear it as well? You seem to be supposed to have a loop
04:08
yeh i will eventually do it based on an iteration
but for time being typeof is defined when they are holding "false" bool
clearTimeout(timers[3]); shouldn't execute in your sample when timers[3] is undefined
so it tries to clear a non existing timeout
correct it should not
timers[3] holds "false"
typeof false is "boolean"
but thats true based on my if statement
yes i know thats what my problem is ..
Why not clear it unconditionally?
04:09
what do you mean ?
Alternatively, you could check if timers[3] is a number
so is_int then
longhand version: typeof timers[3] === "number"
shorthand version: timers[3] === +timers[3]
ok
thanks :)
the shorthand version rejects NaN as a number. Doesn't matter with timeouts.
04:15
ah i see :)
If you need your IDE's code generation tool, then your language is too verbose
04:34
@JohnLandis 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.
05:16
@JanDvorak Isn't timeouts being numbers implementation detail?
@BenjaminGruenbaum it's actually in the spec
Show me?
Iirc, clearTimeout on not-timeout is legal
> The setTimeout() method must run the following steps:
> 1) Let handle be a user-agent-defined integer that is greater than zero that will identify the timeout to be set by this call in the list of active timers.
...
> 6) Return handle, and then continue running this algorithm asynchronously.
clearTimeout on non-timeout is legal, but I wasn't sure
> If handle does not identify an entry in the list of active timers of the WindowTimers object on which the method was invoked, the method does nothing.
There once was a girl from Nantucket,
Who had a nice fancy bucket.
She mopped up the floor
And went to the door
To answer it.
06:10
@JanDvorak Right you are :)
I think node.js does timers differently (Which is allowed of course since it's a different spec, no window and all). setTimeout in node.js returns an objects, which has an integer valueOf
huh?
why?
Yep, in node.js it's an object
is it a Number?
Nope, one sec
or just a number-like
06:14
one sec
That
That makes sense though since node.js has much more powerful scope with domains
You can try/catch on an asynchronous function, it's crazy good
2
Q: Javascript Asynchronous Exception Handling with node.js

Benjamin GruenbaumI'm currently working on a node.js app and I'm having the ususal asynchronous code issue. For learning purposes I'm implementing an http server over node's tcp module. This server supports (express like) routes. For example I have code that looks like this: server.any("/someRoute",function(r...

(Look at the syntax in the bottom)
damn it, i don't want to go to work
I'd like to emphasize that I'm very confident you can get a better job, then again I have no idea where you're coming from
Beauty is more important in computing than anywhere else in technology because software is so complicated. Beauty is the ultimate defence against complexity. [David Gelernter]
06:33
@BenjaminGruenbaum I can't see anything that concerns the return value of setTimeout. Nice atry, however.
Thanks, it's not about the return value of setTimeout, it's about timeouts having to be considerably more complicated in node.js since they're bound to a domain and not globally
They run inside a domain, and only propagate outwards if not handled on the domain level, kinda like DOM events in JavaScript
06:47
Which doesn't prevent them from being representable by an integer handle :-)
G2G, sry
07:27
0
Q: How do I make an entity move once per second in crafty.js

IfeanyiI am trying to implement "Snake" using crafty.js but I can't seem to get the snake entity to move just once in a second. How do I do this?

07:38
@OctavianDamiean Yep
@Nexxpresso Thing is, they're just words he made up. For different sites, that he probably won't link to his identity here, he must have used other words he made up
0
Q: Add checkbox with label to a form

toschoFor a WordPress login form I have written a small plugin. It adds a checkbox with a unique name to the form and if that name is not present in the login POST request it just dies. The idea is preventing scripted attacks made for regular WordPress login forms. The PHP code is okay (imho), but I ...

@jAndy, THE GAME!
08:04
guys
is nav ul li + li selector compatible in all browsers?
08:34
how to come images from background in a slider??
my slider is working on diagonal move
08:46
wut
i have a slider which moves from diagonally left upper to bottom right. but the images comes over the website . i want to come this from background
09:17
@TemporaryNickName No, it is not.
@upcomingdeveloper You need to better articulate yourself if you want help. I don't understand what you're saying.
Anyone has experience with Safari browser extensions?
Can I ask you guys a question?
@BenjaminGruenbaum Nope. Still trying to get TipRanks on Safari?
09:33
It works, but randomally it doesn't load about one every 4 times
It's probably crossrider's fault (we use them for cross-browser development, safari wasn't a development goal initially). I'd like to know if I can solve it myself though
Ah
That's a strange problem
Not really, there are many places to mess up building something that complicated, our application is thousands of lines of JavaScript, loaded dynamically and has to stay synced through a 3rd party API which is thousands of lines on its own
@Jan 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.
09:56
damn
molly quinn is hot
Exception is a great feature when you want to keep bugs for another day
user1125394
10:15
> let it crash
Context: airport tower
11:03
@SOChatBot agreed.
11:25
@TemporaryNickName Your avatar is bugged.
Haha nice
@AmaanCheval (Delayed) Replied to your earlier reply...to a reply. Check your email. I will be holding questions as I have to go now as well.
hmm, then I need to throw in more exceptions handling and threads right?
Hola @Zirak.
@TemporaryNickName Yea more threading is the way to go.
11:37
So
NOT_FOUND_ERR: DOM Exception 8: An attempt was made to reference a Node in a context where it does not exist.
Why am I an idiot?
php is bad
@Zirak Sure
Hello
I would like to put a cookie in an xmlhttprequest
11:55
@Sergio Put it in my mouth. :)
@Sergio Ok, that's great for you
@OctavianDamiean /r/nocontext/
I tried request.setRequestHeader("Cookie","mycookiecontentblabla"); but in firebug it says
I bet Firbug complains that you didn't give me the cookie instead ...

« first day (911 days earlier)      last day (4262 days later) »