« first day (1053 days earlier)      last day (3913 days later) » 

1:04 AM
@user1043793 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.
 
1:20 AM
Internet explorer bugs will never cease to surprise me
1
A: Can anyone explain why focus() is not working always on IE 10?

Demetrius AmadeusSolved!!! After a lots of frustrating tests I discovered that the input control was nested inside a DIV which in some circumstances was disabled, dumb of me to disable a DIV. ...However all other browsers only actually disable the input control if it is explicitly disabled. The guys at Microso...

 
 
1 hour later…
2:33 AM
dead room is dead.
 
2:49 AM
Dead synth3tk is dead
 
Why? What did I do?!
 
You live
 
Ok? Thanks?
 
@LogicalAngel 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.
 
!!Thank you
 
2:57 AM
@LogicalAngel You kiss-ass
 
BLAH!
 
lol. fail
 
I got setTimeout(function() {textarea1.value = textarea2.value}, 1) to work to solve the problem that the onkeypress handler would call my function before the inputted character got to the textarea's value.
 
document.innerHTML.replace('s', ''); //Web programming in lisp
 
Well now.
 
3:06 AM
 
Reminds me of that Futurama episode where Fry drinks 100 cups of coffee.
 
Probably a little of both.
 
Texas did have an earthquake today, I think.
 
Does anyone know why you have to use function(){functionName()} in a setTimeout?
setTimeout(function() {functionName()}, ms);
I was trying it with setTimeout(functionName(), ms); for a minute and it wasn't working.
 
3:13 AM
setTimeout(functionName, ms)
() calls it
 
Oh. dope
 
You want to pass the function (name), not the result of calling it (name())
 
You have to use the handle, like an addEventListener.
Interesting. Well, at least I know both ways of doing it now. I guess you use function() {functionName(variable)} if you're trying to pass a variable to the function.
 
You can also use bind
!!mdn bind
 
I didn't know you could do that.
 
IE can't
 
Now you know
 
I was just about to ask if it was Mozilla-specific.
 
3:18 AM
Oh well. I don't use Mozilla.
 
@JanDvorak Well shit. What other common stuff can't IE do?
3
 
@KendallFrey The sarcasm is strong with this one.
 
@LogicalAngel See also: call, apply
 
@KendallFrey getElementsByClassName works since IE9
 
There's a question I've been wanting answered for a little while.
getElementsByName doesn't work on IE.
 
3:19 AM
it does
byClassName, however...
 
@Kendall Are call/apply IE-implemented?
 
Also, old IE (5.5 or so) did not support multiple classes on a single element in a CSS selector.
@LogicalAngel yep
 
Does Caprica do msdn?
 
@LogicalAngel <condescending>I do not use IE.</condescending>
@LogicalAngel Not that I know of. (I don't think MSDN has a good API)
 
!!mdn apply
 
oh, m`s`dn. No, I'm not using that.
 
Calls the function with arguments as an array? How would you use the array?
!!mdn call
 
@LogicalAngel What do you mean use it?
 
I don't know how you would seperate the arguments from the array provided.
 
3:25 AM
JS does that for you.
 
!!> Math.max.apply(null, [1,2,3])
 
@JanDvorak 3
 
!!> (function(a,b,c){return a+b+c;}).apply(["Hello","World"])
 
@KendallFrey "NaN"
 
?
I didn't expect that.
 
3:27 AM
!!> (function(a,b,c){return a+b+c;}).apply(null, ["Hello","World"])
 
!!> "hi" + undefined
 
@JanDvorak "HelloWorldundefined"
@KendallFrey "hiundefined"
 
So, you could do onkeypress="setTimeout(functionHandle.call(this), ms)" function functionHandle(someObject) {someObject.someProperty = someThing}
 
Oh, I forgot this, didn't I
 
@KendallFrey positive
 
3:27 AM
@LogicalAngel You probably want bind for something like that.
bind returns a function object
 
@Seanny123 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.
 
Well, I want something that IE implements as well, for cross-browser compatibility at least.
 
Just use what you did originally.
the inline function
 
Yeh
Here's a question: Do you think it's better to do window.onload = functionHandle; function functionHandle() {statements} or window.onload = function() {statements}?
 
neither, if you're using jQuery
otherwise, it's just a stylistic difference
 
3:36 AM
Don't say "if you're using jQuery"
It's not like a library has anything to with it
 
I figured window.onload = function() {expression} might be more process-efficient.
 
  document.addEventListener("DOMContentLoaded", function(event) {
    // use this
  });
@LogicalAngel No and it's not even close
 
No? It's more process-efficient to do it the other way?
 
Not even remotely, they are absolutely the same
 
3:41 AM
I figure the browser has to additionally go through the process of locating the function's handle name at least.
 
I guess it's not really a practical difference.
 
it has to parse the whole script in any case
 
There's a theoretical, minimal difference, that couldn't be measured with things that measure the half life time of Ununoctium
 
you have to hoist all functions before you can do anything that touches the scope
@copy well, everything under one nanosecond is probabilistic anyways
 
3:45 AM
I failed at finding an element with a really short half life time
Darmstadtium
 
3:57 AM
Is the capture/bubble option required in an addEventListener("eventType", functionHandle, capture)?
 
CAM
Hey All, anyone using ST3>?
 
Also, if you use the eventType, addEventListener("DOMContentLoaded", functionHandle, capture), does the eventListener disengage after the event fires, or is it still attached?
 
CAM
i am having Fullscreen issues where its not doing a native fullscreen in OSX
 
4:20 AM
Anyone know anything about Firebase's Javascript API?
 
not much. i know it was implemented in a hobby website that i help with. why?
 
I'm using firebaseReference.child("childName").on("child_changed", function(snapshot) {document.getElementById("textArea").value = snapshot.val().text}); and its returning "undefined"
 
hey everyone does any one have an idea about .ics file
 
NVM, I figured it out. When using "child_changed", the snapshot returns the value of the changed child; there is no need to reference the object's members explicitly.
 
@RoyMJ 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.
 
4:31 AM
Say, "!!Thank you."
 
Hii all, Is there an alternative to jsbeautifier.org which will preserve html,script and php contents but will format in a good way?
 
Format it youself.
lol
 
its not what ive written, but rather an edit work.. so i thought of making it clean before i do my work..
 
Would it be against the rules to ask if anyone uses Ruby in this room?
 
4:34 AM
Probably not.
 
Ruby devs are like bigfoot. I've seen pictures, but I've never been able to chat with any.
4
 
@gopalsaini 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.
 
I've been having the same problem with Firebase.
Doesn't seem like many people are into it.
 
I know both Ruby devs and Firebase devs (I'm two degrees away from the founder). Whatdy'a need?
 
4:39 AM
Hey, it's you. I thought you might, you're the one who pointed me to Firebase to begin with.
Thanks much, by the way, it solved my problem quite nicely.
 
@paulcheung 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.
 
!!Screw you.
 
@LogicalAngel That didn't make much sense. Use the help command to learn more.
 
0
Q: How to create and generate the single .ics file with multiple in html using javascript

CathyI would like to know about .ics file, How to create and generate the .ics file wit multiple events in single file in html using javascript. Some what like this link, I have searched the google for source code but I am unable to get it. I got to know that to generate the .ics file we have write d...

 
hey there, is that possible to validate data in my web form before do submit?
 
4:44 AM
can any one tel me
 
What do you mean by "generate"?
 
download the .ics file
 
i mean if i can use jQuery.validate plugin
 
Em... use ASP's File interface, I guess.
XMLHttpRequest->ASP script to save file
 
(function () {
$("#upload").click(function () {
$("#form").validate({
rules: {
version: "required",
subtitle: "required"
},
messages: {
version: "Please"
}
});
});
});
 
4:50 AM
@CodeFarmer 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.
 
5:24 AM
anyone in backbone
 
ask the question, please.
 
this is my cillection
define(['jquery','backbone','model/statistics','mmc/utils'], function( $, Backbone, Statistics,Util) {
var StatisticsCollection = Backbone.Collection.extend({
model: Statistics,

init : function(){
var _this =this;
new Util().fetchData("STATISTICS",{success : function(data){
///console.log(data.toString()) // JSON data from server
// _this.add(new Array(data)); //
_this.reset(new Statistics(data)); //

console.log( _this.models); // not working why ?
},fail: function(error){
this s model
define([
'jquery',
'backbone'
], function( $, Backbone) {

Statistics = Backbone.Model.extend();

return Statistics;
});
but collection.add(), and collection.reset()
not working
all files are in correct location
 
Please post code by itself, and hit Ctrl+K before sending it. That way the format makes it readable. Thanks.
 
sorry
any one?
 
5:42 AM
Any one plz help me no backbone devlprs ?
 
5:58 AM
Someone who can help me with my textarea cursor position problem, let's chat on it! go here: alawaplace.com/COREchat/core.html
Type something in the textarea
It's a real-time updating chat that updates on keypress. However, each time the value of the textArea is updated, it moves the textArea's caret to the end of the textArea's value. How would I prevent it from doing that?
 
@Michaelzh 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.
 
Tread quietly, the help vampires are afoot
 
The what now?
 
@SomeKittens Sssshhhh! They'll hear you!
 
6:10 AM
That oughta keep them busy for a minute or two.
 
Then they'll be back claiming that they're not vampires, they just need help
 
Followed by their pasting all 3k lines of code and asking why a button doesn't work.
@LogicalAngel yeah, i'm seeing that issue. i'm not experienced enough to help, so here's a picture of a puppy. dogbreedinfo.com/images9/AlaskanHuskyKiraSmile.jpg
 
Aww.. thank you.
 
I'm puzzled
0
Q: What is return in JavaScript?

Souvik DasWhat is return in JavaScript ? And what is advantage of using return function ? I can also get 16 by doing this -- var number = function ( ok ){ confirm( 8 * ok ); } number(2); ______________________… So, What is the advantage of using return function ? var timesTwo = function(number) { retu...

 
6:19 AM
oh thank god another regular!
@dystroy I need some bleach. For my eyes.
 
Me ? I'm a mercenary, not a regular.
@synth3tk Then read that question.... and you'll need more bleach.
 
also, i've never touched C-anything a day in my life, but why are those tags there?
i don't think i see any C code
 
@synth3tk There's a pending edit to remove them
 
ok
i didn't want to edit them out myself since the question is so hard-to-follow that maybe it did actually have something to do with it.
 
Are you still in there, Kittens?
You'll have to forgive the bugs, it's just a basic archetype.
 
6:26 AM
@synth3tk Some bleach for a "food loving guy" : dystroy.org/re7210/index.html?file=shooter.html
 
@OctavianDamiean good morning
 
@dystroy That looks and sounds absolutely amazing. I think I saw something like that once on a TV show.
Who actually starred that question? You need to be banned from SO.
 
@synth3tk It is amazing. My wife calls it the best sandwich in the world. I did it twice. It worked very well both times but I'll still be afraid the third time, because it looks easy to fail, for example with a too wet meat.
@synth3tk I always star this kind of questions, just so that I can see the next morning how they turned
 
@dystroy Ah, ok. Makes sense.
 
And the star will disappear. I've always between 15 and 200 questions starred. I clean the list every day.
But I didn't vote to close, I couldn't choose a reason.
 
6:32 AM
Same here, lol. I was struggling with myself over it before saying "eff it".
 
@vinaykumar 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.
 
anybody worked on codemirror
 
So, I would save the caret position, then restore it on update.
 
Without a proper legend, this graph is meaningless. Is bigger even better ?
 
6:43 AM
@dystroy the lower quantity is better
 
It's 255 units! Must be high quality!
 
They should add "wait for a json object to come through a websocket connection and reply through webrtc" in this test, to get rid of the irrelevant bars.
 
What would I use to scroll to the bottom of a textarea?
 
Internet Explorer 11 is awesome, from waht it sounds
i hope this time they dont come out after being insanely late
 
They will.
 
7:02 AM
Do you know when they are supposed to release it?
 
As the name implies, IE11 is supposed to be released in 2011. Sometimes they slightly miss the target.
 
@dystroy No no no, you're confused. It's supposed to comply with standards in 2011. It'll be released on November 11th.
 
What would I use to scroll to the bottom of a textarea?
 
meh, most of the implementations don't implement promises/a+ correctly
deferred and laissez faire had suspicious performance compared to how badly optimized their code was, turns out they fail the spec tests
 
@Farhad 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.
 
7:08 AM
Ok @CapricaSix
 
oh the benchmark is broken? removing some libraries caused 150% improvement
 
@Esailija you might not get any answer, but please keep your comments going. I'm probably not the only one who ponders about using a promise library here (or writing one)
 
You mean having jQuery, Prototype, and Mootools all installed "just because" is a bad idea?
 
@dystroy well you can just use mine, it's already far more optimized than anything out there and passes all promises/a+ tests
although I don't have docs or github yet
 
Did you make a shiny web page full of promises ?
 
7:15 AM
the most common use of promises is if you're making a political website
 
no I was frustrated how every promise library claimed they are "fast" and then I read the code and it is completely shit
 
Making a github repository is done in minutes
 
(in terms of how javascript engines optimize code)
although 14 levels of indentation is poor for readability too.. :D
 
@Esailija even jQuery's?
 
You have 14 levels of indentation in your code or are you speaking of other ones ?
 
7:16 AM
you're promising us a Github? pinky swear!
 
@dystroy no
 
@JanDvorak they're not really promises, at least not A ones
 
this library has 14 levels of indentation github.com/medikoo/deferred/blob/master/lib/deferred.js#L79
it doesn't implement spec correctly and has shitty overall performance
indentation = creating closures = bad performance = bad readability too?
 
One of the reasons I sometimes want to use promises is to have 4 levels instead of 7... (not accurate numbers)
 
with proper promises you can have just 1 level -> the point is the ability to flatten any callback hell
 
7:18 AM
@Esailija async.js?
 
that's how I got interested btw... I never knew about that because Jquery promises don't do that
@JanDvorak nope, isn't that just something that takes an array of callbacks and executes them sequentially?
you cannot have sync-like flow control with that
 
async.js has control structures
 
well that's not my point
 
This code looks hellish to maintain
				if (this.promise.pending) {
					if (value.pending) {
						push.apply(value.pending, this.promise.pending);
						this.promise.pending = value.pending;
						if (this.promise.dependencies) {
							this.promise.dependencies.forEach(function self(dPromise) {
								dPromise.pending = value.pending;
								if (dPromise.dependencies) {
									dPromise.dependencies.forEach(self);
								}
							});
						}
					} else {
						value.pending = this.promise.pending;
					}
				} else if (value.pending) {
 
^ yea that's the 14 levels of indentation that is shit for performance too
 
7:20 AM
I don't like this style
 
:D
 
@NishamMahsin 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.
 
@JanDvorak the promises just have .then which can already make throw and catching errors in "sync-like" fashion work
there is no need for control structures because the basic ones already work
 
sync-like exception handling? Nice
 
it's the closest thing to async keyword
that works in browser too
like consdier this
getUsers().then(function( users ){
    users = users.filter(function(user) {
        return user.id > 3
    });
    if( !users.length ) {
        throw new Error();
    }
    return getUserData(users);
}).then( function( usersData ) {
    usersData.forEach(function() {

    });
    return getMore();
}).then(function(){
    //final function here
}).failed( function() {
    //the thrown error is caught here
});
and wait for the sync equivalent
try {
    var users = getUsers();
    users = users.filter(function(user) {
        return user.id > 3
    });
    if( !users.length ) {
        throw new Error();
    }
    var usersData = getUserData(users);
    var val = getMore();
    //final stuff here
}
catch(e ) {
    //the thrown error is caught here
}
 
7:25 AM
so the intermediate functions are required to return a promise whose resolution will trigger the next one?
 
yes, that's what jQuery promises don't do, and they don't do the tricks to make the errors work either
I mean with jQuery promise you have to descent into indentation hell because it doesn't sequence
and I never knew that was the point of promises
 
I was thinking of making a similar stuff but I thought of passing callbacks rather than expecting promises. Nice one.
 
before that I had just used jQuery "promises" which obviously have very little advantage to just taking callback functions
 
This article was posted recently (yesterday or the day before) on reddit
 
yea that's how I found it :D
earlier I had posted this news.ycombinator.com/item?id=6269079 but didn't care back then
 
7:28 AM
How do you set the caret position in a textarea?
textarea.selection = num; or something like that?
 
I created new library because optimizing existing ones would require pretty much full rewrites
 
Can I remove the useless tags and reduce the room description so that there's more space for the starred comments in the right part of this page (laptop here) ?
 
flotation device and consistency comes to mind
 
I am an owner but don't know how to remove tags :D
 
I am not an owner and also don't know how to remove tags.
 
7:38 AM
room topic changed to JavaScript: New User? Read rules.javascriptroom.com [ecmascript] [javascript]
room topic changed to JavaScript: New User? Do read rules.javascriptroom.com [ecmascript] [javascript]
 
Welp, clearly that didn't work.
 
room topic changed to JavaScript: New User? Read rules.javascriptroom.com [ecmascript] [javascript]
Too bad there's no preview...
 
@Nikki 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.
 
hi
 
halo
 
7:45 AM
object.setSelectionRange(index, index) works on IE, is there any cross-browser compatibility issues with it?
 
Hi. is it possible that [.]+ will treat any char ? ( except for \n etc...)
 
You probably want .+.
 
@jsky 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.
 
http://stackoverflow.com/questions/18455866/how-to-get-multiple-http-responses-on-same-page-for-this-poll-script
can anyone help me with this?
 
@jsky Try simplifying your question
 
8:00 AM
hmm. yeh good idea
 
I have a server question: when speaking in terms of bandwidth usage, are you refering to the total amount of data passed through the server over a timespan, or the amount of data passing through the server at a time?
Like 500GB per month total amount of data travel, or only 500GB of data at a time.
 
@jsky try and remove any plugins etc that are not required and make your question less specifc, people will be able to answer the question more easily and the question will be of more use to other in the future.
@jsky this may be causing issues. <div class ="my-poll">
@jsky remove the space between class and =
 
8:17 AM
@Blowsie hmm, thanks ill give it a try
@Blowsie didnt help.
 
@jsky also try formatting your code so people can read it and check for syntax errors. Good luck
 
@Blowsie thanks
 
This looks like a fun game! en.wikipedia.org/wiki/Mafia_(party_game)
 
8:28 AM
@OctavianDamiean how come? Also I am not even close to awesome. Though github is amazing.
 
@AbhishekHingnikar Haha
 
@SomeGuy In France this old popular game isn't about the mafia but about villagers and werewolves. It's frequently played by kids or adults (complexity being adapted)
 
Yeah, a variation of this one is called "Werewolf".
 
@SomeGuy whats so funny about it ?
 
> Dmitry Davidoff (Russian: Дми́трий Давы́дов, Dmitriy Davydov) is generally acknowledged as the game's creator. He dates the first game to spring 1986 at the Psychology Department of Moscow State University
 
8:30 AM
"Get an ad-free experience in IE."
 
This is bullshit, I've played it when I was a kid, before 1986
 
@SomeGuy :-)
I wonder if thats so to promote internet explorer or to show the browsers incapability of being able to render them
 
But as I don't have any proof, I can't denounce this fraud on Wikipedia :\
 
8:43 AM
@HimaniKothari 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.
 
I know this is the PHP room but if anyone has a spare few minutes I'd love a second pair of eyes on this - stackoverflow.com/questions/18575564/… everything seems fine to me but not working as expected, the same code in a fiddle works perfectly - jsfiddle.net/f49V8/13 so I'm completely at a loss
 
1 message moved from PHP
 
or the JavaScript room....
 
@DrewR 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.
 
8:55 AM
@martincarlin87 $(this).closest('td') in the context of $(document).on('click' makes pretty much no sense at all ....and I didn't read it properly :-P
 
@DaveRandom - you had me confused there but I was hoping to hell you were right as I am bewildered why it's working in the fiddle and not in my code
 
@martincarlin87 I've tested it yesterday. As the code you show works, we can't do anything for you. You'll have to debug and seriously look for what differs between your page and the fiddles. Before that, you probably should close this question.
 
Hi, I am thinking of a possible use of JSON with JavaScript: Is it practical to store JSON output to a 'text' file, so I dont have to read the database everytime the page is called...
 
Sam
@DrewR Hello
 
@martincarlin87 Needs a live example (i.e. your actual page, not just a working fiddle) to debug.
 

« first day (1053 days earlier)      last day (3913 days later) »