« first day (1662 days earlier)      last day (3292 days later) » 

11:01 AM
Guys, how do I declare a variable in jQuery ?
3
 
@mindfreak 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.
 
We need to go to the golden hall of jQuery, step on the diamond $(podium) and speak out loudly: "I DECLARE FOO EQUALS 42".
 
user986408
can anyone give me tips on how to build a production-level email job/worker? i thought of using something like github.com/Automattic/kue and poll the database every 2min or so and send the mails, but no idea if this is best practice
 
@jAndy - I have a fair knowledge of Javascript, but still a novice in jQuery...
 
...
 
11:05 AM
@mindfreak excuse me, but I doubt that
 
Guys, xbrowser question
How do older browsers treat unicode characters in strings?
 
maybe you have used very misleading words or don't know what you actually want to ask, but declaring a variable is no business of a javascript library
 
@darkyen00 yeah I have only used RAF twice ever.
 
$.declare('variable')
 
@mindfreak wait, are you serious?
 
11:06 AM
Do I have to escape characters like ™ or ⅖ with \u2122 and \u2156?
 
@monners :D
 
and once, it wasn't even wise to use RAF, I used it to detect window visibility.
 
@taco lol, I'm not on the same level as Anthony but thanks :D
 
also 'yo Mama' will ofcourse not be used if you provide a title :D
 
Or is it redundant as long as the Content-type is set to utf8 correctly?
 
11:07 AM
@jAndy - Well, I got it now... Thanx anyways
 
@AwalGarg I wasn't thinking off
 
@Julo0sS @dystroy nginx does indeed have direct support to proxy websocket connections efficiently
 
var oldQuery = window.$;
window.$ = null; //temporary remove jQuery
var foo = 42; //declare varialbe
window.$ = oldQuery; //add jQuery back;
 
@AwalGarg well... I know that
 
stop trolling him
@mindfreak you declare a variable in jquery the same way you do in javascript
 
11:09 AM
While that was a bit of troll it did include the answer
 
@darkyen00 - thanx mate :)
 
if you are wondering how to define a function on jQuery so that you can do $("foo").something(); thats a different thing.
 
You can also add properties to jQuery objects, but there's barely any reason to, if at all
 
I really think this is a misunderstanding, not live not death
 
@dystroy hrmm I didn't read the entire conversation just read the ping and your message after that
 
11:11 AM
@darkyen00 jQuery.fn.something = function() {} IIRC
 
@AwalGarg I'm -lost- client/server websockets :(
 
@AwalGarg Just to clear it : dystroy.org uses nginx as proxy in front of miaou and I chose nginx just because it was so good at proxying websockets
 
@Julo0sS I suggested you to use nginx instead of apache for websockets because it is easier to configure nginx for websockets than apache. You now need a websocket implementation for your backend language
 
@darkyen00 - Actually, I have written a validation code for Login Page in Javascript.... was in the process of rewriting the entire code in jQuery.... hence was wondering if jQuery did had a different procedure ??

Now, it seems to be all clear..
 
@AwalGarg downloaded & install node.js
 
11:13 AM
@dystroy right, I used your nginx config as reference when I started with nginx :D
 
@AwalGarg but... even with tuts...
 
@mindfreak jquery is merely a javascript library
 
@Julo0sS please don't refer to tutorials unless you understand http and ws protocols in general. tutorials only spoil you.
 
it is still perfectly valid javascript
 
@darkyen00 s/valid/terrible/
 
11:14 AM
infact one of the most loved & hated part of code in javascript.
@AwalGarg why is jquery terrible ?
 
Thanks again for clearing the air...
 
@darkyen00 jquery's internal code is terrible
 
@darkyen00 sigh we've been through this
 
John Resig would decline
 
The price outweighs the benefit if you know you only need to support modern browsers.
 
11:15 AM
We can't have this argument every day. It's like tabs vs spaces...
 
@MadaraUchiha not you.
 
It does a decent job at ironing out defects for you when you need IE9 and lower support
 
actually my question is specifically to awal :-)
 
But if you don't care for IE9 or lower, it's rather pointless.
 
@darkyen00 sure, I have ranted about it on a blog. just a sec.
 
11:16 AM
@AwalGarg I'd just like to understand how ws work to 1st make some kind of chat to make sure i get it, and then build more complex things based on ws, this seems "easy to do" but looks like Im to stupid to understand basic logic on that
 
It just became like a fashion or trend to troll about jQuery in this channel, I guess all popular things have been through this
2
 
@jAndy only if the question doesn't make any sense
 
@Julo0sS You don't refer to tutorials if you want to "understand". To understand, you use the manual, read other people's code, understand the protocol, environment etc.
tutorials are to copy paste code and get shit done
(mostly)
 
And the source code or specification. (or both!)
 
11:22 AM
@AwalGarg open close send things, server listening, client sending etc... i read about this already. What I thought was that (your) nginx thing would act like the server listening and not just as proxy. Now need server for ws
 
@AwalGarg i have an urge to rant your article
> In jQuery, the browser developer tools do not offer any such error handling mechanism. You have to be on your own.
and you gave an example of a typo error.
 
Does anyone have any experience with RevealJS here?
 
while jqueries silent errors are more clearly understandable by $("#hello").show(); vs document.getElementById("hello").style.visiblity = 'visible'; The latter will throw a runtime error, which the former will silently "gulp".
 
I agree that jQuery hides error. But what I agree to are errors like setting class of no element, because of a typo in the class selector.
In vanilla, the console will throws some error, since you do not have the element. Not in jQuery.
Exactly like darken00 said.
 
// $('div').append($(elem).clone()).html() vs elem.outerHTML ?
what ??!?!
 
11:27 AM
In the rare case you need outerHTML, use it... ^^
The fact you use the jQuery library doesn't imply you can't use native DOM properties when needed
 
@JanDvorak @jAndy Any experience with revealJS? lab.hakim.se/reveal-js/#
 
@doodla No. And don't ping randomly, please
 
ok
 
@dystroy why on earth do i need to append it somewhere ? .parent().html() would be a better solution, no ?
 
@darkyen00 no, as the parent may have other child nodes, but [0].outerHTML is OK
 
11:29 AM
and you could even smart it up... @jAnD was just enough to ping us both
 
@jAndy >:(
 
very weird. yeah [0].outerHTML was my first thought too.
Oh okay.
 
@dystroy that is blasphemy. If you use jQuery, you are not allowed to use native DOM methods or properties. If you do, ... well.. you better don't.
 
@SomeKittens mac makes you bum.
@jAndy thats react not jquery sir
 
@darkyen00 no actually thats sarcasm.js
 
11:35 AM
aye, captian
ps i wish there was something like domComponentRef.setProps(domPropsGohere);
in react.
but then i can refactor my code to do the same reusing the render
 
@jAndy Is that OK ?
Seen today in a #StackOverflow *answer* : $(this)[0].getAttribute('src')
3
 
@dystroy yes of course !
 
yes, he edited since
$(this)[0].getAttribute('src') is, ahem, the opposite of smart. Use this.src or $(this).attr('src') if you really want a $. — dystroy Sep 3 '14 at 12:39
 
You should have waited untill after the grace period :)
 
11:44 AM
@ivarni By the way, how did you find it ?
 
@dystroy googled "$(this)[0].getAttribute('src')" site:stackoverflow.com
 
Git... API? Git doesn't have an API... — Madara Uchiha 22 hours ago
 
with quotes around the code
 
i'm so sorry, i use gitlab, download from about.gitlab.comshundao 9 hours ago
-_-
 
Guys do you know how to resolve an IP into a country?
I need a fast solution, because I get milions of IPs per day xD
 
11:45 AM
@darkyen00 so? You get the point right?
 
@Neoares I'll tell you once you convince Facebook that I didn't take a trip to the middle of Iran yesterday
 
@JanDvorak I'll do
 
@Neoares There are databases who do that.
 
But I've heard that there are databases that do that
:D
@MadaraUchiha thanks :)
 
Not guaranteed to be correct though.
 
11:50 AM
@darkyen00 the article was for beginners, and hiding errors from beginners is really terrible
and yes, that is how you get outerHTML with jquery, unless you learn the standard api, in which case you would just use the standard api and not jquery
 
Good morning! If I want to build a website, but I don't know any serverside language, is it a good practice to use angular.js for it's routings system, and MVC? Or should I stick to jquery?
 
You might be a little short with just jQuery server side.
 
@BenFortune I've downloaded the database, and it's storing the IPs without dots...
 
Yep.. that's why I'm considering using angular... for views, routing, etc... It would make easier to work within a team using MVC structure.... But I don't know if using it would be simply counterproductive, because I don't know if angular goes well on this kind of case
 
11:58 AM
@darkyen00 what?
raynos was the founder of this room, right?
:D
 
some pop-corn stuff
iirc nope but he used to be really active
 
@darkyen00 ahh, but I don't understand your rant :/
 
you need to read raynos ranting on jquery
there was a gist
gist.github.com/Raynos/1613169 no no no don't one box you piece of jerk
 
I have read it, pretty nice.
I didn't rant about what is already known, I know jquery is not needed. I ranted about why it is actually bad. Leaky abstractions and no errors etc.
 
> Promises, deferreds, futures, etc aren't that useful. Favour managing callbacks and using flow control techniques.
the whole rant is... I don't know a polite term for that...
 
12:05 PM
@dystroy whose ?
 
> DOM2 events work (shim=domshim). You don't need anything else.
this is a bit of an overstatement
 
About radio buttons. How do I toggle a radio button by clicking in the entire horizontal space of that button instead of just the button and hte label?
is it possible? any hacks?
 
Wait. Was that gist some sarcasm ? It's difficult to tell as it's always difficult to tell when jquery critics are sarcastic or legitimate :\
 
@doodla wrap in the input in a label tag
or set for or whatever
 
@dystroy it's legitimate
I think he's changed his mind somehow though
 
12:07 PM
@AwalGarg What?
 
that was years ago
 
@AwalGarg An example or fiddle please?
 
neowin.net/news/… --- microsoft made it more efficient to swear. an emoji for the middle finger
 
it's by Raynos
 
@doodla Sure, let me do your work for you, completely free of charge.
 
12:09 PM
that was his "jQuery is worse than the devil" - time
 
so instead of fuck you windows, now you can save your fingers a long workout and simply do a single emoji.
 
@doodla ^ does that suit your needs, sir?
 
such UX is adorable !
 
@AwalGarg That doesn't work.
 
12:10 PM
cool, time to debug.
 
label {
  display: block;
}
 
@AwalGarg not what I wanted, anyways. What I want is the radio button to get selected when I click on the whitespace to the right of the Text( in the same space)
 
@doodla what doesn't work here?
@doodla oh, okay, then set the label to display:block like dystroy suggested
label is inline by default
 
works now
thanks guys
 
@GNi33 which kinda sucks
 
12:11 PM
not really
 
wow nokia lumia 435 <3 <3
 
lol
 
@GNi33 I always add a display block
 
I came across more use-cases where I need it to be inline than anything else tbh
 
hello
 
12:12 PM
@IssacJohnson 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.
 
@GNi33 another fun thing with labels/radio buttons in ie8: translate.google.com/…
 
The default styling properties of DOM elements matter less and less, we're just used to change them anyway...
 
@FlorianMargaine which is actually good, setting it to anything. trusting default styles can do weird things to users with altered default settings
 
flex all the things!
 
given, they are a very marginal user - group, but still
 
12:13 PM
@GNi33 reset.css
:P
 
that's what normalize.css-styles are for
hehe, exactly ;)
 
@dystroy is our local flexbox expert
answering flexbox questions since 1998
 
@FlorianMargaine oh, yeah. horrible
 
.chucknorris { display: flex; }
 
still "onpropertychange" was a kind of useful event
 
12:14 PM
@FlorianMargaine I didn't get any love for that :(
0
A: CSS Flexbox app layout issues

dystroyFixed CodePen I made 3 changes : 1) I've set the height of the body to the desired one : body { height: 100vh; } 2) I've given to the left container the right boxing model : .layout-left, .layout-right{ display: flex; flex-direction: column; } 3) In order for the panels to not overf...

 
.chucknorris > .hand{
   flex: 1;
}
 
machine-guns to pigeons, but it was useful
 
.chucknorris > .beard {
    flex: 9999;
}
 
need help I can't pragmatically upload the document in google drive from iphone. but the same code works in my desktop.
 
pragmatically?
 
12:15 PM
.chucknorris > .penis {
   flex: Infinity;
}
 
.javascript > typeof { sense: none; }
 
.bradleymartyn { display: flex; }
.bradleymartyn .bizep { display: block}
@darkyen00 hah
 
#rlemon code::after { content: ''; }
 
STAR ALL THE THINGS
 
i use the path as /drive/v2/files/ in gapi.client.load is it possible to upload file from iphone to the google drive api
 
12:17 PM
#benjamin *:not(msc) {
   can-do: none;
}
 
#rlemon:has(.beer) code::after { content: 'EVERYTHING'; }
 
@Loktar ohh btw, I got google music importing playlists from CSV
groovebackup redirects to the notice now
so less useful for that now
 
gapi.client.load('drive', 'v2', function() {
var request = gapi.client.request({
'path': '/drive/v2/files/',
'method': 'POST',
'headers': {
'Content-Type': 'application/json',
'Authorization': 'Bearer ' + access_token
},
'body': {
"title": that.workingFolder,
"mimeType": "application/vnd.google-apps.folder"
}
});
 
this is the code i using
 
12:18 PM
@dystroy, re: StackRating. I agree that it's really unfortunate that questions with only one answer isn't considered. This is a limitation inherent to Elo, which is still by far the best rating system as I see it. :-/ I doubt this problem matters in the big picture though. In the long run the rating reflects acutal ability, and more + earlier in ones history would be reflected by more - later on.
@dystroy, (btw, your rating is quite impressive. position 46 :-)
 
> 192k
 
@aioobe Are you involved in stackrating ?
 
yeah, I wrote it..
 
Okay today is about 1 month complete of my Windows Phone
Being very honest, I like it a lot.
 
@aioobe nice work, altough I find one problem with the rating; it doesn't take tag fragmentation into account
IIRC Elo works with assumption that players are mixed and matched from the whole pool
 
12:22 PM
@aioobe This is a beautiful and interesting thing. But I still think the questions I was the only one able to answer are often more valuable than the one I just answered a little better than other users
 
this isn't the case here
 
right.. That's another issue.
 
what's stack rating?
 
@dystroy, I couldn't agree more, and it's unfortunate.
 
is it possible to upload a doc file programmatically into google drive from iphone by javascript
 
12:23 PM
@AwalGarg, an effort to estimate StackOverflow users rating i.e. "skill".
 
@BartekBanachewicz It might deal with that better than SO though : if I answer a java question I get much more points than a Go question just because there are many voters. ELO partially fixes that
hint: When I want to repwhore I just look at the java stream of questions...
 
@aioobe have been wating for someone to do it, open source?
 
@AwalGarg ---"google"
 
@AwalGarg, stackrating.com I can put it on github if there's interest.
 
12:25 PM
@aioobe It's probably interesting
 
@aioobe I am interested in the algorithm you use.
 
It's described in detail on the about-page: stackrating.com/about
 
I'm 2375th
huhu
 
I am 1512
 
5277th :>
 
12:27 PM
@aioobe You run your thing once a day, right ?
 
it runs continously. Scans for new questions every 2 minutes, rescans young questions every 2 minutes, and then has an exponential backoff and stops revisiting questions once they are 3 months old.
 
lol 3,294,475th
 
@MadaraUchiha That's a beautiful troll. I hope there are some tats :)
 
I hate front end fraemeworks
 
12:31 PM
@aioobe Why did this give -6.46?
 
chrome is filled with weird stupid rendering bugs isn't it ?
 
If I was the only person to answer, then surely it shouldn't give or remove any points?
 
@dystroy There's one who has "picnic table" in Japanese tattooed on their waist XD
 
@KendallFrey "Deep fried noodles"
 
12:37 PM
Hahaha
 
MGE
Hello, Im using json_encode from php, and the problem is that I have concat problem with ' quotes
how can I solve this?
 
can you do this? An answer to a question was just "change your code to: code"
-1
A: Using array value as an array name

vikrant singhChange your code to var colours = { 'red': [ 'item1', 'item2', 'item3', 'item4' ], 'orange': [ 'item5', 'item6' ], 'green': [ 'item7', 'item8', 'item9', 'item10', 'item11' ], 'blue': [ 'item12' ] }; //generate coloured boxes for (v...

 
don't use concat?
 
MGE
Im not using concat, the problem is
 
12:41 PM
@BenFortune interested in this too /cc @aioobe
 
MGE
Uncaught SyntaxError: Unexpected identifier
inside of json string var
due to ' quote inside the string
 
@BenFortune, bug. will investigate. Thanks for reporting.
 
@aioobe same with this answer of mine:
stackrating.com/question/28930846 is accepted, so needs 1.0 score, right?
 
What's up y'all?
 
scraping so
 
12:45 PM
Werd up!
^^ Chinese person gets an English tattoo.
 
@kyle.stearns I bet she has "key" tattooed on her other shoulder.
 
@AwalGarg Looks like it should be +3
 
Haha.
:P
 
yeah it has another answer too
 
Dude, is anyone here stout w/ React+Flux? I am wondering if what I'm doing is sound.
 
12:47 PM
Overnight, Wordpress screwed up all my blog posts! In all C++ code with templates it replaced &lt; with < and turned it into HTML tags.
I am not sure how to comment on that
 
@BartekBanachewicz just be amazed
 
@BartekBanachewicz lololol
 
stackoverflow.com/a/29960659/3459110 what is this I don't even...
 
Upvoting, his answer is twice as good as yours.
 
12:51 PM
with a pinch of plagiarism :D
 
can we complain again today about the ms edge logo?
 
They're calling it edge?
Haven't really been keeping up-to-date with it
 
Yeah
The logo is just plain bad
I'd almost rather keep the IE logo
 
Hi
Do anyone has worked on Kendo UI controls?
 
@NickDugger ALiens
 
12:55 PM
Indeed
 
I wonder if they'll support plugins yet
 
@BenFortune they won't, atleast not for the next release.
 
If ever
 
@BenFortune I wonder if they'll support plugins that don't allow the author to remotely format my C: drive.
 
Hey all!
Can anyone see what I am doing wrong here? I can't quite figure it out :)
http://jsfiddle.net/ez2zcozg/
 
12:56 PM
@MadaraUchiha hahahahah
 
Hey guys when I try to change the source of the image I get following error
g.handler.apply is not a function

Here's my code

var img = $("img." + className).eq(indexOfPic);
img.attr('src',src);

while classname and indexOfPic are working fine
 
Hello
 
Oh wow, when did Chrome bookmarks update?
 
didn't updated yet..
 
:(
 
12:59 PM
 
I just scraped the transcript and like a dumbass arr.concat(res)
forgot it returns the new array
 
Is that Baileys?
I fucking love Baileys
 
MGE
I've a problem passing from php to js with json_encode
itle":"I can't make you love me","
 
@BenFortune It was available as a plugin for a while, not they added it natively.
 
MGE
1:00 PM
can't ' quote is crashing, how can I parse this?
 
Mocha or Jasmine -- ready, set, go
 
Mocha
 
reason?
 
I've never used Jasmine ;)
 
fair point
 
1:02 PM
@darkyen00 how to filter call logs by type (in/out) in lumia?
 
$("img." + className).eq(indexOfPic).attr('src',src); //TypeError: g.handler.apply is not a function
 
I use Mocha and Chai for most of my testing though
 
I've never done testing... I'm gonna learn
 
!!afk
 
PS: i am trying to replace eval() in the project => You seem to be trying to replace eval with a more complex solution with the same problems. It only makes it worse. — dystroy 53 secs ago
 
MGE
1:06 PM
Someone knows how to escape string before json_encode? because I have problems in js with json string with single quotes (')
 
gist.github.com/rlemon/a09b53ef1fadd03ccc3e this is all of the youtube oneboxed links posted in jam exchange
 
I didn't know that was a thing
 
@MGE Example JSON? You're probably doing something wrong
 
ms edge dev tools still suck. They've not changed much :(
That's depressing
 
@AwalGarg 1. Its written straight there, 2. You have a search.
 
1:08 PM
@darkyen00 AwalGarg is afk.
 
other than that i haven't really needed to filter them... yet
 
crl
Look its public contributions graph: github.com/royhowie
"This is ates"
 
how to retrive text and image in struts or spring
 
@GopiSankar We don't do Java here, sorry
 
ok @JanDvorak u give any url sample i am tring lot off
 
1:17 PM
@GopiSankar http://example.com:8080/learn/proper-grammar#or.go
 
crl
http://l.il
 
Random coding... I don't know what to do...
-1
Q: How do I get the inner html text for a label element using jquery

Jon KittellI want to get the inner html of this element. <label for="ctl00_ctl00_MainContent_ContentPlaceHolder_chkUsers_0">DOE, RICHARD A(033495)</label> However my jquery returns undefined for customerLabel. var customerLabelId = $('label:contains("ContentPlaceHolder_chkUsers_0")').attr("for"); var cu...

 
@dystroy work?
:D
 
@FlorianMargaine I must do something to keep my mind from dying when doing some work tasks...
 
1:28 PM
same
 
wat... jasmine pls
> Expected { x : 32, y : 128 } to be { x : 32, y : 128 }.
 
so, I was trying to recreate this pen while trying not to copy anything from His code. Thoughts? codepen.io/MateiGCopot/pen/OVyVBQ
I think it went pretty well :D
the feels are quite different, can't really figure out why
 
Both are pretty. But the logic doesn't seem the same
 
no?
some parameters may be different
mainly the radius deminuishing rate I think
 
@BenFortune, @FlorianMargaine, The delta is computed as the difference between post[i-1].rating and post[i].rating. I'm suspecting that some question was deleted, causing post[i-1] to actually refer to post[i-2]... I'm not entirely sure though. Regardless, this should be corrected in next "big recalc". I don't run the recalc very often though because as of now it takes 3h and the site is down during this time... (did I say it was a weekend hack?)
 
1:41 PM
god... testing with jasmine means like twice the code... that's crazy
I at least see how some people say they write tests before code, though
 
@NickDugger I have almost always much more code for the tests than for the function, on critical pieces of code
But I don't write tests for functions that I can't imagine regressing
 
1:53 PM
best chair NA
 
shop
 
unfortunate shop
real chair, no american flag.
 
shop of the unfortunate
more likely :P
 
This question is asked every day...
-1
Q: Should I store my jQuery selector(s) into a variable?

rangerover.jsI'm curious the different between $('#btn').click(function(e) { e.preventDefault(); //do sth }); Note : $('#btn') and this : I store my selector into a variable and re-use. $btn = $('#btn'); $btn.click(function(e) { e.preventDefault(); //do sth }); Note : $btn Now im...

 

« first day (1662 days earlier)      last day (3292 days later) »