« first day (1990 days earlier)      last day (2951 days later) » 

12:27 AM
hi guys, I have experiencing a very strange problem
 
@user198989 Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
anyone here ?
 
Hey
 
12:44 AM
hi
 
> b
[Function: CheddarLiteral]
> t.Token
[Function: CheddarLiteral]
> t.Token instanceof b
false
does anyone have any idea why this is returning false? b is a class and t.Token extends b. new t.Token() instanceof b works, so am I doing something wrong?
 
Guys, I have just added this simple script to my page, but however it works reversely :) it works only if you scroll to top http://jsfiddle.net/nick_craver/gWD66/
site is fardrop.com/caski
I almost ate my brain, pls someone help me, I can even pay...
 
var $window = $(window);
var $document = $(document);
$window.on('scroll', function() {
    if ($window.scrollTop() + window.innerHeight == $document.height()) {
        alert('bottom!');
    }
});
 
let me try
 
oh wait
 
12:53 AM
TypeError: window.on is not a function
 
^ updated, it had a typo
 
user406009
@Vihan No. You are on the right track. You can't use instanceof directly between two "classes" (constructor functions, whatever).
 
user406009
You can only use it between an object and a class.
 
YES!
omg man you are hero
 
any ideas on what I do then? t.Token.prototype instanceof b doesn't work either D:
 
12:55 AM
god damn problem which costed me days
 
@user198989 you need to learn basic debugging
 
please send me your paypal
yeah
I used console.log() ,
what should I consider to use
?
 
debugger;
and chrome dev tools
 
ok mate thanks a lot!
 
1:23 AM
hi i didnt know about this chatroom before !
 
@HassenDhia Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
@phenomnomnominal hey, did you see Aussies getting kicked out of the World Cup? :D
 
@Zirak typo in (I think your) bot. "Pleasedon't" doesn't have a space
 
@RahulDesai sure did, hilarious.
 
lol
My best bet for the final - NZ vs. India!
 
1:28 AM
guys , can anyone tell me what about jobs page in this website , i allways see the link but i dont really understand what it mean !
 
@HassenDhia Well, its just job search.
 
ofc , i know but they tell much more about CV , i mean how to go that way ?!
 
Can you please be more specific?
 
in the jobs webpage , that one you posted in you msg , there is make personal CV , i mean if i started working on that , what kind of CV i need to have , certificates ? or my cv in this community about Q&A
 
user406009
@HassenDhia It's just an alternative to stuff like LinkedIn. Put whatever you want there, but I don't think it's that helpful.
 
user406009
1:37 AM
It's not really an alternative to applying to jobs normally.
 
@HassenDhia Pull all your stuff that helps you land a job.
 
@RahulDesai we know how that will end up :P
 
@phenomnomnominal you never know :P
lol
 
lol , is my answers are taken under consideration ?
 
@HassenDhia depends on the company that you are applying to
 
1:39 AM
ok thanks
 
1:57 AM
@RahulDesai Impressive. But I was more impressed with Afghan.
's performance
 
@littlepootis Yep. They got more respect today.
 
 
2 hours later…
4:03 AM
guys, feel free to not answering this. in Javascript, how can i get selected option value from dropdown? what is the function called? onChange()?
 
4:25 AM
769
Q: Get selected value in dropdown list using JavaScript?

Danferd LanHow do I get the selected value from a dropdown list using JavaScript? I tried the methods below but they all return the selected index instead of the value: var as = document.form1.ddlViewBy.value; var e = document.getElementById("ddlViewBy"); var strUser = e.options[e.selectedIndex].value; /...

 
done it
still not working
 
is your code in a window.onload?
try debugging
 
tried debuggin in firefox, when i click the dropdown option. nothing happened also
 
the code is an an onchange correct?
 
btw, i used onChange="disableCheckbox()"
 
4:28 AM
can you add the code of disableCheckbox()?
 
1 message moved to Trash can
@RidleSambow Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
var option = document.getElementById("permission");
var selected_option = option.options[option.selectedIndex].value;
if (selected_option == "pribadi") {
    var element = document.getElementsByClassName('unit');
    for (var i=0; i<element.length; i++) {
        element[i].disabled = true;
    }}
 
@RidleSambow try: var option = this
 
this?
 
I'm getting thise value through AJAX: {\n \"end-time\": 1459726200001,\n \"since\": 757552999\n}
is there any way I can "clean" that to simple json object?
 
4:36 AM
@Frondor What do you mean by "clean"?
 
just like: { "end-time": 1459726200001, "since": 757552999}. I'm using AngularJS, and I don't like Regular expressions
 
hello frondor
 
Hi Ridle
 
tried
var option = this;
onchange=this();
onchange=this;
nothing happen
 
@Frondor So is there a literal "\n" in the code or is that just representing a newline?
@RidleSambow any errors in the console?
 
4:38 AM
Yep. That's not a problem, I can modify the api to remove the new lines. But I can't remove the scaped strings like \"
 
nope
 
so I have to deal with them
 
@Frondor what error does JSON.parse throw?
 
is there any native js function to "clearn" that string?
oh I'm gonna try
 
@RidleSambow put console.logs every line. see at which line the logs stop comming.
 
4:39 AM
you lost me there, sorry
 
@Vihan Seems that did the magic I needed :D Thank you very much
 
console.logs every line?
 
gotta google that function now
 
@RidleSambow yeah, after every, just put a console.log so after line 1 put console.log(1) after line 2 put a console.log(2) etc.
 
inside the script tag right?
 
4:41 AM
yeah, inside the function
 
text=JSON.parse(text.replace(/\n/g,''));
The \'s don't seem to be an issue
 
@vihan my man! option is undefined, gonna try figure that out. thank you bro,

i'll be back -terminator
 
if they remain persistant, use this: text=JSON.parse(text.replace(/\\n/g,'').replace(/\\"/g,'"'));
My initial test appears to removed the \'s, so I doubled em up to be sure they would stay
 
@GregBorbonus i dont understand, where should i put that btw?
 
@RidleSambow no problem :)
 
4:47 AM
@vihan its not working bro, i figured out that the var option = this. as soon as i changed it to getElementByID, nothing appear in the console
 
@Vihan Or...... just use the debugger.
 
@RidleSambow ^
 
sorry Ridle, that was not for you
 
JSON.parse('{\n \"end-time\": 1459726200001,\n \"since\": 757552999\n}'); seems to be doing the job for me
 
@Frondor Then you ran into the same thing I did and that's that the \'s don't matter
 
4:49 AM
Newlines between key: values is valid JSON. JSON.parse() should be more than capable of dealing with that.
 
@RidleSambow Have you made sure that your option variable is correctly being interpretted?
 
Less code, easier to read, no RegExp... The world just became a better place
 
console.log(option);
and make sure it's the correct dropdown?
 
Btw, any of you knows about AngularJS and its compile thing?
 
@Frondor Absolutely, however, I could not tell if you were giving us the output of the Javascript interpreted version(console.log(text)) or if you were giving us the output from the raw call itself. I made the assumption that you console.log'd it.
 
4:53 AM
Hence, use a debugger, instead of just planting console.log calls everywhere.
 
@GregBorbonus Nope, it was pure raw output of course, directly from the api api.github.com/gists/6c863d86eaf3a4360c3f
 
I understand that now.
 
With the debugger, you can pause execution at any given line of code, look at all the variables, and use the console in that specific context, including this and all the local variables.
 
@MadaraUchiha that said, the debugger has a (little) bit of a steeper learning curve compared to planting console.logs
 
@Vihan thanks for saying it, I wasn't sure how to word it right
 
4:55 AM
i figured out, i am using form_dropdown, and pre-set the selected option to something. after i delete it the
form_dropdown('permission', $permission_attributes, '', $js);
working just fine
so, i cant pre-set the first option appear ? except i put it on the first option?
 
@RidleSambow good work, but remember, there are multiple ways to do anything, in your case, an even handler might be best, but if you want to call it from another place, a function or direct call to the element would be best.
No, you can preset the option that is selected.
Give me a few
I'll write up some quick examples
 
@GregBorbonus gotcha
@Vihan Thanks for the advices btw bros
 
raw js or jquery?
 
@Vihan that's fair, but it's definitely something worth learning.
Using a debugger is hardly unique to JavaScript, practically any form of development has it in some way or another.
 
@GregBorbonus checking that out
 
Very simple design
but should show the functionality
is that what you were looking for?
 
@GregBorbonus lol yeah, just knew i could do that. i have a long way to go i think. btw thanks bruh
and, didcha use jsfiddle to try out/simulate all your javascript?
gonna go grab some lunch, see ya later boys
 
5:37 AM
yup
 
6:12 AM
I'm voting to close this question as off-topic — Paulpro 5 mins ago
 
7:03 AM
@Vihan wow. genius
 
8:02 AM
happy monday everyone!
We're all here, forced toghether to work for a greater society
doing our best on a world full of darkness and unknowns
and although madness is there always looking for us, what can we do but be bystanders and keep doing what we're told to do
it all comes down to how much do you really care about people, progress and everything
but how can we be so sure this is not for nothing? There is no way for us to tell, but you got to have faith
look at the direction the clever ones are looking at and head there, because, face it, there's nothing much else you can do
 
Nothing matters, everything ends eventually.
 
even if you wanted to, you'll find yourself outside of the beautiful equilibrum that most of us are trapped in
I have no idea where I was trying to go btw
 
@towc did you watch a haskell lecture or what?
 
anyone wants to keep the nonsense going? I feel like you can do a hell of a lot better at saying things that add no value to anything but kinda look deep...
 
that's exactly what haskell strives on
 
8:19 AM
@AwalGarg o/
 
\o
 
Shoot me ?
 
get me with the same bullet please
 
I'd like a couple more years of fresh air
 
@AwalGarg you live in Delhi.
 
8:29 AM
new day old question integrating s3 with my node.js service for saving images and receiving it
 
@Abhishrek hah
 
8:58 AM
morning
 
@Frondor its a string you are getting. Just use JSON.parse(yourVariable) to get the object
 
@KishoreBarik Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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.
 
9:37 AM
I am trying to integrate a third party api

When I hit the api the control goes through their system and then they redirect to a link specified by me via post method with some data alongwith it (x-www-form-urlencoded - format).

I am using node.js at the backend therefore I will get the response firstly to my node server. Let's say I gave the link domain.com/log3rdpartyrequest and now I can handle that request via app.post(/log3rdpartyrequest) on my backend.

My question is how can I load page with data received. I can send only one response therefore if I do res.sendFile(myfile.html) - how
 
9:54 AM
I found something interesting and i can not understand what it does
document.onreadystatechange = () => {//code} what exactly does this = () => {//code} mean?
 
it's assigning an arrow function where the // code is where you write your code
 
so this is called a arrow function ? first time hearing about it, thnx will look into it
 
yep, they're new in ES2015
they are equivalent to function () {}, but they have a shared this value with the outer scope
also you can't use arguments in them
 
@FlorianMargaine I kinda wish that to be written in Java
just for the lols :D
 
10:33 AM
where is ready event of $(document).ready(..){} in these event phases?
Is ready just a wrapper? let me check
Is ready just a wrapper? let me check
// Handle when the DOM is ready
	ready: function( wait ) {
 
11:07 AM
@any one worked with the s3 sdk for node.js
 
11:55 AM
afk rebooting
done
 
@Abhishrek skype
 
@AwalGarg why ?
 
because
 
12:40 PM
@Loktar holy fuck TIL
    "folder_exclude_patterns": [".git", "node_modules"]
in sublime-settings
no more node_modules or .git in my sublime folder sidebar
!!learn myjam <>http://chat.stackoverflow.com/rooms/39426/jamexchange-fm39-426
 
@rlemon Command myjam learned
 
 
I want to make a Chrome extension to open a new tab with specified content, not specified url. i.e. I want to store a page inside my extension. Possible?
 
yes
data:text/html,<all the codez>
 
well then
 
12:59 PM
hey
can we add div to html list ?
 
trying to google information about this is failing github.com/…
I just get docs on how to use babel :P
anyone know what the fuck that call does?
 
thankyou
what a horrible thing to try and google
 
"directive" was the key word
 
Why doesn't this work to sort optgroups in my <select> element ? jsfiddle.net/y9n2pep2
 
1:12 PM
@Adrian you say "get the collection of elements, sort them, do nothing"
as in, you never update the dom with the sorted list
 
so i need to remove the children then add the sorted collection ?
 
const elms = $(stuff).detach(); // detach removes them from the dom but keeps reference
elms.sort(..).appendTo(stuff);
sort of like this
 
ok, thanks!
 
crl
.remove()
 
but be careful with your sort method
you often don't want to re-wrap crap with jQuery there
 
1:15 PM
worked jsfiddle.net/y9n2pep2/1. is this ok ?
 
crl
var b = document.body.remove() hmm I thought this would keep the reference
 
0/
 
i didn't even know that was rewrapping.. i was just using $() for everything . if it's already a jquery object and i use $() on it what happens ?
 
you waste cpu cycles
$() is the jQuery constructor
 
1:20 PM
oh.. that means i have a lot of changes to make to my code. thanks for everything
 
@Adrian When you have an existing jQuery object, and you wrap it with $(), you're re-wrapping.
 
looks like the next .js Framework Wave is here with React.js, or is it a game changer.. weigh in
 
@crl remove isn't specified to have a return value: dom.spec.whatwg.org/#dom-childnode-remove
 
Bleh, how do you load sass with webpack?
 
(b = document.body).remove()keeps the reference, for example
 
1:23 PM
can somebody give me regex of validating username
 
lol
/.*/gi
 
@rlemon beat me to it :P
 
best regex
 
user has me ignored
so you can go right ahead and tell them how silly that request is
 
!!tell Phoenix google regex validate username
 
/^username$/
 
crl
!!urban sass
 
@crl sass Attitude, mouthing off, not backing down to the man, putting the smack down, opening a can of Bruce Lee.
 
favorite regex site? regex101.com
 
crl
 
Hi Guys
 
@AnayaP Welcome to the JavaScript chat! Please review the room rules. Pleasedon'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 need some help
Please checkout my question on this link - stackoverflow.com/questions/36259008/…
I need help - I want the accordion to be collpased on page load-root element along with nested elements
any help is greatly appreciated
 
1:46 PM
jsfiddle.net/y9n2pep2/3 why does this return 4 instead of 2 ? my select only has 2 immediate optgroup children, but it counts the nested ones as well.
 
Cripes, what did I come back toi?
 
@Adrian I believe that's how it works
@Trasiva help them :D
 
@Adrian Yep. thats how it works :-)
 
@SterlingArcher it is, you cannot nest optgroups
 
@SterlingArcher But, that takes more effort than I'm willing to give on a Monday after the weekend I've had.
 
1:52 PM
they collapse to a single level
 
@rlemon ^ that too
 
actually i can do it
and i am doing it, then flattening them out but it works nevertheless
although i have read that it is not supported
 
@Trasiva lol
 
you probably can hack it. but nesting optgroups is invalid
 
@Adrian Not supported, that means you probably shouldn't do it.
 
1:54 PM
48
Q: Nesting optgroups in a dropdownlist/select

Ed WoodcockI have created a customer c# DropDownList control that can render out it's contents are optgroups (Not from scratch, I edited some code found on the internet, although I do understand exactly what it's doing), and it works fine. However, I have now come across a situation where I need to have tw...

 
I went to the casino this weekend. Broke even, but it was still super fun
 
Yea. the solution is a bad hack it looks like. The other (non-accepted) answers look better.
 
Although all the cig smoke in the air gave me a monster headache
 
@SterlingArcher If you broke even, you won.
 
That's how I see it. I drank for free and had a great time
 
1:55 PM
my hack is to add nbsp's at the start to make them look nested and it works. however when i try to sort them i fail because the sorting flattens them out
 
I was up $65, but I lost that at slots before we left (I knew i would, I had just never played slots so I wanted to)
 
there has to be some hack to get only the immediate children. after all it's just xml
 
But our blackjack table was super lucky. Everybody left the table with money
 
I usually only play blackjack.
 
I went from $200 -> $20 -> $350 -> $265
My buddy made freaking $500 at the table
 
1:57 PM
@ton.yeung Depends on the person. Smart people walk away if they've gambled for a couple hours and walked away even.
 
@Adrian give them appropriate class names
or don't try to break the DOM API?
 
7 hours of blackjack, and only 3 dealer blackjacks. They said they've never seen such good table luck before
 
@SterlingArcher My mom's always been lucky at the slots. Every time they've gone to the Casino, she leaves with a four plus figure check.
 
@SterlingArcher It's not about luck there sometimes. If you have good guys at first and last chair, they can manipulate the dealer pretty nicely.
 
1:58 PM
last two times I went to the casino I was up 160, then down 20
wouldn't mind going again
 
If your whole table knows what they're doing, most people can end up doing decent.
 
we only have slots around here tho
 
Yeah our guy who won big was in the first seat, and we had a guy simply playing the book in the hammer seat
But the whole table was just us, so it was all us friends playing so that in itself was fun
 

« first day (1990 days earlier)      last day (2951 days later) »