« first day (1873 days earlier)      last day (3089 days later) » 

Or just use document.querySelectorAll
 
especially since you are already using FormData instead of jQuery's vesion of that.
 
@JacquesMarais document.find is a more powerful version of QS
 
.querySelector() in this case. he is looking for single elements
 
Alright, updated my node
 
3:00 PM
It was just never implemented by browsers
even though it's in the spec
 
erm
this.form? :D
 
document.body.find('> main')
 
@djsmiley2k I hate you
 
@Luggage what's jQueries version?
@rlemon K, so not like that...
 
2 mins ago, by rlemon
my first suggestion is to stop using jQuery right now, learn a bit more about how DOM interactions work and how the APIs function.. then use jQuery to be lazy :D
 
3:02 PM
I'm googling
 
.serialize(), i think? I don't know, but dont' worry about it. you don't need jquery
 
you're doing like 10X more work struggling
 
$(this).parents('form:first')
 
@Nick Oh, I didn't even know of document.find :P
 
var someElement = document.querySelector('#someId');
 
3:02 PM
you could have licked this DOM crap 4 days ago if you sat down and learned the "old school way"
 
@Luggage doesn't do files
 
oh
 
that's why I'm using FormData...
 
@JacquesMarais Yeah, you'll have to polyfill it if you want to use it; no browsers every actually implemented it
 
crl
you don't need .find anyway
 
3:02 PM
> licked
 
Somebody remove the $ key from his keyboard, kthx
 
Oh :P Wow
 
@crl if you want to support IE8, yes you do. Not every browser supports the :scope flag
 
`Then how will you use ${templateStrings}?`
 
crl
jquery.find == elm.querySelectorAll(...)
 
3:03 PM
@Nick IE8 has QSA
 
@rlemon Yes, I'm aware, but it doesn;t support the :scope flag
 
why do I need the scope flag?
 
It's very useful
 
then use sizzle. thw query selector 'engine' from jquery
 
da fuq is the scope flag
 
3:04 PM
^
 
@Nick convince me
 
crl
don't we just need IE11 in January :) ?
 
@crl hahahahahah
 
@crl True :D
 
Does anyone ever need IE?
 
3:05 PM
@ShotgunNinja Everyone does
To download a browser
 
@rlemon document.body.querySelectorAll(':scope > section') // finds all sections that are direct descendants of the body.
 
@Cerbrus wget
 
It's very useful
 
3:05 PM
Unless ou have something on a USB
 
or you have a sane package manager
 
if you have a sane package manager, you don't have IE
 
Fair enough
 
I am looking like an afghan cop right now
 
well, i guess windows has a 'store' now, but i've never used it
 
3:06 PM
woodworking is fun
 
The closest thing to a sane package manager on Windows in general is Chocolatey
and that fucking sucks
 
@AwalGarg the taliban?
 
yes
 
@Nick document.documentElement.querySelectorAll('body > section');
sure, less elegant
point is you don't need it
 
and you have to install chocolatey
and issuing a stupid command to enable all of powershell
 
3:07 PM
Doesn't windows 10's powershell ship with a package manager like thing?
 
does it?
 
!!google windows 10 inbuilt cli package manager
 
@rlemon what if you have an element stored in a variable, and want to search relative to it, without repeating its selector to get it? myElement.parentNode.querySelectorAll(myElement.something + '> section')? That's shit
 
yeah, its there
 
3:08 PM
@AwalGarg get some good wood rasps and carving knives
 
@Luggage why the hell did they put powershell on windows and then disable it?
 
@Nick and your scenario is shit as well :P don't do stupid things
 
Got me.
 
is there really no es6 beatufier yet
 
anytime I've had to use powershell I've had to ensure that command got run..
 
3:09 PM
that makes me sad
 
@rlemon I would love to, but... reasons...
 
@rlemon It's still a scenario. The scope flag is useful, and you're ignoring it simply because you don't need it. You also don't need lambdas; what's your point? Convenience is bad?
 
@Mosho make one
 
3:10 PM
@Nick I'm not ignoring it, it was never implemented. why polyfill something that isn't required?
 
I shouldn't have suggested document.querySelector
 
@rlemon So we should also not use libraries, because you can already do everything without a library, so why use it?
 
that is a logical fallacy
we also shouldn't wear pants
 
No, it's very comparable to the point you're trying to make
 
We shouldn't. I'm not
 
3:11 PM
@JacquesMarais You didn't. You suggested querySelectorAll(), which was wrong for this case. :)
 
I concur. I hate the concept of clothes. I wish our world didn't know of this "fashion" thing.
 
@Luggage did you just tell me to go fuck myself?
 
They only help in winters.
 
querySelector() is exactly what the original person needed.
@Mosho ...?
 
var formStuff = document.querySelector('"' + jiraID + 'Form"');
var myForm = new FormData(formStuff);
 
3:12 PM
libraries solve problems, polyfills make up for inconsistencies with features.. this isn't a case of feature inconsistency when it has been dropped in lieu of something else.
 
what is this shit? '"' + jiraID + 'Form"'
 
Wearing clothes feels like a burden to me, in summers.
 
clothes is for non-programmers and non-lazy people.. or something
 
@AwalGarg live in Canada
 
@rlemon It wasn't dropped, It's still in the spec
 
3:12 PM
clothing is not optional for 8 months a year
 
@Nick the ID varies D:
 
@Nick string concatenation.
 
Right, but since I don't...
 
3:12 PM
@Luggage with extra quotation marks
 
@Nick is it? or is it in a working spec and not in a finalized spec? ( I really can't remember, but I am leaning towards 'working spec')
 
man I feel so ill
D:
 
ohh, didn't notice.
 
Also, most academic institutions impose strict uniform guides here. They suck sooo bad.
 
@rlemon Either way, it was never dropped, they just never came to a final decision on it, but it's still there
 
3:13 PM
the code he posted didn't have that: var myForm = new FormData('#' + jiraID + 'Form');
 
Oh I don't need them?
 
unless I missed some, which is likely.
 
Anyone know if it's possible to set the console position for each website differently?
 
@Nick that can be said about a whole shit tonne of things :D
it isn't really a good argument for why we need the feature
 
@djsmiley2k querySelector(something + somethingElse)
@rlemon I never said we needed it, I said it was useful
 
3:14 PM
@Nick ahhh i see
 
We don't need jquery, but yes, sometimes it can be useful
Not sure why this is an argument
 
var formStuff = document.querySelector(jiraID + 'Form');
Better?
 
@djsmiley2k yes
 
no
 
\o/ progress
 
3:15 PM
if it's an Id, it needs #
 
yeah
 
OR.. use document.getElementById()
 
@djsmiley2k composing an id is ugly
 
then, no #
 
Though you may not have a choice, so no judgement, just saying
 
3:15 PM
@Luggage nahh, why remember more than one dom selection method
so lame
:D
 
...
D:
 
because i like understanding code I read? And the ability to write some myself now and then? :)
 
wooo
No errors, now to see if it actually works :D
YESSS¬! \o# \o/
 
@SterlingArcher what, the actual. fuck
 
3:19 PM
\o/
 |
/'\
 
I can't even understand wtf is going on there.
 
@Luggage clearly a male stick figure
 
I've just said to work I'm sopping there as my head is spinning
 
@SterlingArcher :DD
 
Well, you see, when you put together specific characters on the keyboard, it can make images
 
3:19 PM
at least that works, so thanks again guys :)
 
Ones with penises, apparently
 
Oh hey @Luggage, btw, that javascript you sent yesterday seems to work great, forgot to say thanks for the help with that
 
I am learning, yes I realise it's backwards stupid take 10x longer than it needs to learning, but it's something :)
 
@djsmiley2k That means you've learned something, congrats ;)
 
@Neil haha
my nose/face is all bunged up and can't breath
 
3:21 PM
0
Q: How to make a jQuery function accessible from anywhere?

drake035To make a regular JS function accessible everywhere I just need to declare it outside jQuery(document).ready(function($){}). But what if this JS function contains jQuery stuff? How then can I make it accessible from anywhere, particularly from different JS files?

Jesus
 
Boss already told me to work from home to make sure I don't pass it to everyone else.
 
How do you even reply to this
 
errr
 
@djsmiley2k Sweet
 
why would you want a function before the page is ready? (Honest question!)?
 
3:21 PM
This question has been closed as "Depressing".
 
Also work mac just decided it no longer wants to display.
 
user image
4
god dammit
 
Need some help... if you have a few minutes .. stackoverflow.com/questions/34045816/… Thanks
 
I'm not sure what a probematic is, but I don't want it.
 
3:24 PM
lol :p
maybe i should change title isnt clear
 
@SterlingArcher If I raise my kid right, even when we're arguing we'd make jokes like that
 
How do you even kid
 
I don't even kid
 
@SterlingArcher You don't kid, you must wait
 
That's deep
 
3:27 PM
not really
 
Look at the bullshit on this website whatswithoutinternet.com
(Enter any number. Even a 2 digit number works)
 
oh my god
 
Hahahaha that's great
 
wait.. did somebody put gloves on jesus? ._.
 
@phenomnomnominal Don't tempt me with a good time baby.
 
3:32 PM
:P @SomeGuy So fake..
 
@JacquesMarais And people still fall for it
 
@SterlingArcher no that is repairs
his hands crumbled off
 
Yep..
:P @rlemon
 
3:34 PM
@SterlingArcher my real name isn't actually Nick
it's Nicholas
#confessions
 
Santa?
 
Satan?
 
yes
I prefer Saint though
 
Saint Satan?
 
you're getting a lump of coal this year
 
3:36 PM
Relevant
 
.. There's 3 nick users here..
 
@SomeGuy Did you get past the Human Verification?
 
everybody has a nick
but only some of those nicks are nicks
 
@KendallFrey No, I'm sharing it with 10 friends right now
 
3:38 PM
although I don't think any of the nicks is nick
 
from the word satan
 
@nick @Nick @nickB @nicki and ME!
 
crl
!!how assholish is the lounge?
 
@crl 11/10
 
has anyone heard about the game sad satan?
 
crl
3:38 PM
oh Cap you're great
 
I'LL HAVE YOU KNOW
 
the deep web stuff
 
@rlemon that is one proud papa
 
3:39 PM
@SomeGuy no need
 
@SterlingArcher lmao
 
!!choose JavaScript, Lounge or Nothing
 
@KendallFrey No? I just closed the tab when I got to that point
 
@JacquesMarais JavaScript
 
3:40 PM
@SomeGuy Just read the source
 
this is what i was talking about
 
crl
!!would you accept to marry me?
 
@crl Doubtfully
 
!!why ?
 
@rlemon That didn't make much sense. Maybe you meant: why
 
3:41 PM
!!why
 
@rlemon because you touch yourself at night
 
crl
!!are you single?
 
@ShotgunNinja because you touch yourself at night
 
@crl Certainly
 
3:41 PM
eh, usually more in the mornings, but whatever
 
jsFiddle updated their site...good for them.
 
!!is @crl good enough for you?
 
I dislike it
 
crl
like 24hrs ago
 
no dark theme
 
3:41 PM
@JacquesMarais Of course!
 
Yeah, it doesn't give a list of common libraries anymore
 
@KendallFrey Hahaha, damn.
 
crl
@CapricaSix :)
 
@Cereal yea it does
 
@Cereal It does, under the JavaScript selection
 
3:42 PM
click on the javascript label on the javascript panel
 
Oh
Thanks
 
@CapricaSix i touch myself during the day
 
liar
 
3:43 PM
at night there are others to touch
:v
 
!!who is awesome
 
@JacquesMarais <
 
Ahh thanks
 
!!why
 
@nickB because you touch yourself at night
 
3:43 PM
not again
 
...
!!is nickB a self-night-toucher?
 
@JacquesMarais Certainly not
 
every question's answers cannot be who touches what at night
:p
 
!!tell JacquesMarais sandbox
 
@JacquesMarais Please go and play in the Sandbox
 
3:44 PM
I just realize I haven't written a for (let index=0; index<array.length; index++) in javascript ever until today...
 
:'( But I don't wanna
 
too bad
 
so you wrote for(var index=0; index<array.length; index++) before today
 
crl
> ever
 
3:45 PM
@JacquesMarais I've already arranged a safe pathway for refugees to the JavaScript room in case the Lounge gets closed
 
@corvid why not for (let i = 0, l = array.length; i < l; ++i)?
 
@ssube Because I never used that in college, what's it do?
 
@nick Well when the Lounge people move to here, then I'm moving to another room.
 
me too
 
@ssube because unless you are altering the length of the array the compiler should optimize that for you #thatGuy
 
3:47 PM
Well, certain ones.
 
you mean that C++ lounge people?
 
holy shit!
 
@JacquesMarais why?
 
let them play whatever they want to play. nobody moves.
 
@nick Not all of them, just a few of them. And for specific personal reasons..
 
@corvid Caches the length and pre-increments. Both optimizations that don't matter in JS.
 
How do you know so many things, ssube?
 
@JacquesMarais Don't worry, the kind of behavior that goes there would absolutely not fly here (especially not that we have a mod or two active).
 
@ssube Phew, thanks :P
 
3:49 PM
@corvid that was a common practice in JS a few years ago and is common to do in other languages for performance reasons
 
@corvid The... normal way? I have a good memory.
 
although I always snark at the ++i vs i++ comparison
 
Don't actually change your loop, since those two differences don't really matter in JS.
 
now why the change then?
 
@rlemon For me, it's still habit from C++ where i++ can call the copy constructor.
 
3:50 PM
i mean why not a common practice today?
 
++i has no downsides, so I just use that everywhere
 
@nickB because the compiler does it for you
 
What do you call the order of execution? I'm trying to understand how JS determines importance, but forgot what it's called.
 
Hello everyone. If anybody who uses Sahi Automated Testing would like answer my question, I would very much appreciate it. Thank you! stackoverflow.com/questions/34046821/…
 
I want all of the lounge people to migrate here.
 
3:51 PM
why?
 
crl
they are too proud of themselves
 
because they're better than you
 
in which way?
 
Sorry, it doesn't look like Sahi questions get a lot of attention.
 
@ton.yeung yes. They're not the best, but as long as they link a main SO question and it's on topic, they're ok.
 
3:52 PM
they don't touch themselves at night?
 
in every way
 
I don't think it's the scope I'm asking about? It's like when JS moves all the variable declarations to the top, even if they were lower in the code. What do you guys call that?
 
user1596138
@rlemon I'm trying to find this gif where the police are putting a HUGE pot plant in the back of the car and this random bystander comes over and starts smelling it. Seen on imgur yet? I can't find it it made me lol // @SterlingArcher you imgur too
 
hoisting
 
Drawing attention to your question on main in the relevant chat room is cool.
 
3:52 PM
@Jhawins yea saw the video
 
unless you spam it to multiple rooms...
 
user1596138
Haha "Ganja??? Ganja!"
 
he says "is this ganja?!" cop says yes he says "it's ganja!"
 
@Nick Yes that's it! Thank you.
 
user1596138
Haha yeah that was hilarious
 
3:53 PM
@Jhawins lol no i haven't
 
user1596138
Ok nvm you already seen it
 
crl
!!how much am I on a pH scale?
 
@crl 5/10
 
crl
oh I thought I was basic
 
user1596138
3:53 PM
@SterlingArcher ^ lol
 
hahaha
 
I can only imagine that ending poorly had it happened in the USA
 
@rlemon *pow*
 
OOohhhhh dat is ganja!
xD
 
@ton.yeung cops are confiscating it, and the kid made a pretty aggressive lunge when he says "yes" to the original question.
sure he just smelled it
 
3:55 PM
@rlemon lmao
 
but still, I can see that going south..
 
dude
 
ist das ganja
das ist ganja
 
user1596138
@rlemon Yeah tbh when I saw that I was like shit you're getting arrested
 
0
A: jquery calculate dynamic equation

user3307017Are you looking for a way to do the calculation? You can use Javascript eval eval(textbox2.innerHTML); Or substring the contents of textbox1 and do the calculation manually.

._____.
 
3:56 PM
If I stored a video's buffer in redis (for caching), would I then serve it up via a writeStream, instead of a readStream, since it no longer resides in the file system?
 
I saw a sheriff's truck on my way to Santa Cruz one time, and it was absolutely loaded with weed
 
so for ... of breaks in babel if you run it over a javascript object?
 
Guys, should something like this work: var byId=document.getElementById; console.log(byId("example"));
 
@Nolski no?
 
Yet typeof [] === typeof {}
 
user1596138
3:56 PM
@Nolski Yea
 
@rlemon not sure how to correctly use a babel repl link
 
I don't understand the hoisting here, and why it seems like 1 is running before and after 2. jsfiddle.net/ft8cp57v
 
@Nolski use jsfiddle
 
user1596138
!!mdn for...of
 
@Jhawins for...of
 
3:57 PM
and select 'babel' as the language in the js panel
 
@JacquesMarais lurn u sum console testing boy
Never ask "should this work" in here
 
@MadaraUchiha lol, I didn't realize you were the center of that Lounge shitstorm until a couple hours after you left
 
Try it, and you'll see ;)
 
@JacquesMarais var byId = document.getElementById.bind(document)
 
Ok.. Thanks
 
3:58 PM
@ShotgunNinja you don't count, because your username isn't nick
 
@JacquesMarais you need to bind the original thisarg (document) back to the method
 
@SterlingArcher I'll try you!
 
@Nick maybe NickNinja would work
 
user1596138
@rlemon Wait why did you say no
 
3:59 PM
@rlemon Oh ok, thanks
 

« first day (1873 days earlier)      last day (3089 days later) »