« first day (3432 days earlier)      last day (1740 days later) » 

14:03
@NIKHILCHANDRAROY Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
1 message moved to Trash can
Hello, I need some help about reactjs, I make a onclick event to increament the value each time click but I can't pass the html tag inside hook. ``` const [sms_text, setSms_text] = useState('');


const inputSubmit = e => {
e.preventDefault();
const txt_value = `<p> ${e.target.text_input.value} </p>` ;

setSms_text(txt_value + sms_text)
}
``` please someone help me, regard's
Jesus christ, split your message up
Tay
Tay
@JBis Did you setup jamesbot so it gives people time now? thats nice.
25 secs to format is useful... I flippin hate when it deletes my code every once ina while cuz I forogot control+k
if it deletes it just paste it again and ctrl+k it again :B
Tay
Tay
I love trying to convert node.js typescript projects into standalone jsfiddle typescript...

*sigh*

https://jsfiddle.net/SirCode/aoqf57jy/
Tried following a lexer tutorial to create a tokenizer.
Didnt work too well
14:19
could anyone take a look at this
http://jsfiddle.net/FM3qu/7/

i don't know why it only works if the id is equal to 1
why are you trying to keep it all in a same file?
@Tay You're missing half the shit you should've copy/pasted
Tay
Tay
;-;
you can easily make it compile everything into a same file using a bundler if you want it to
Tay
Tay
I read through it and Ive merged all the pieces I need together
Im very confused...
i get the purpose of it, but JSFiddle is shit at debugging, and I cant setup typescript locally, so Im sorta screwed
Ill probably just work on it more at home
14:22
why are you even working on personal projects at school? lol
For a start you're using export
And it's not an MJS module
Tay
Tay
Im sorry Ive never used node or imports/exports... I have no idea how this works!! Visible Confusion
holeup
how can I get help here, my account is limited for post. kindly need help or how I can fix the account limitation for post
Tay
Tay
In the comments theres reference to a nice standalone compiler
if people want to help, they will @NIKHILCHANDRAROY
14:23
@NIKHILCHANDRAROY If you're blocked from asking questions on the main site, stop asking bad questions
Tay
Tay
Nikhil I told you that already remember
you have to wait it out
even perm question bans only last 6 months (which is still overrated)
and as for your question, what's sms_text?
Tay
Tay
Lol the JS file literally has like a full tutorial file in it, this may have been what I was looking for!
And its standalone
no scary big gulp and node compiling scheme
@Ikari the sms_text is first const variable for useState hook and I want if I click the setSms_text will serve the p tag with the input value
You're confusing yourself between strings and JSX
Probably
14:27
^
@Tay what's wrong with Ben's link?
@BenFortune please solve me, if I have wrong way
you went to a different source that uses regex
Oh boy
Tay
Tay
It relies on a filesystem and uses imports/exports that I cant even use
Regex?
14:29
no it doesn't
Tay
Tay
ffs
I think this is just out of my league, every time I go into this crap this happens
its either or.
you just want to copy pasta your solutions together
Tay
Tay
Every one Ive used has some kind of problem or errors and I just dont understand whats going on because they show a ton of code and give a short summary
that might work on short term but not on longer one
just rtfm. I know its hard, because I don't wanna read stuff too, but read it.
14:30
because you don't want to learn the basics?
or just skip some reading stuff?
Tay
Tay
IVE READ IT.
Clearly not
Tay
Tay
...
I. HAVE. READ. EVER. SINGLE. WORD.
I spelled it out
do you get it?
yeah. What for platform is it using?
it is clearly said that it is using typescript
Tay
Tay
I dont even know! thats the thing. None of these rely on vanilla JS
14:31
which is far from javascript
Tay
Tay
Karel. Im using typescript
@Tay aha.
you don't
Tay
Tay
but the project has a filesystem setup
otherwise you know what to do
@Tay quite rude
Tay
Tay
14:32
Ya know, Karel. I dont even know what you want at this point
The link ben provided, I spent an hour of my life reading a reproducing
but its NODE
and I cant fucking use node!
Im stuck on stupid JSFIddle because everyone irl doesnt give a flip about javascript
You see now??
why can't you 'fucking use node'?
Have you tried not using a shit editor
I don't get it...
Tay
Tay
Everything else is BLOCKED
dude, don't do it at school
Tay
Tay
14:34
Ive mentioned this MANY MANY MANY times before
what about repl.it?
I think I've told you that at least 10+ times now
Shouldn't you be doing school work then?
and we have told you a million times your internet filters aren't our job to deal with
Here, I'll help you
Tay
Tay
14:34
No ben, because my school work is done.
@Tay so what? Node.js is fairly close to JavaScript
i would have given him a warning first
Tay
Tay
How is that going to help at all... Im clearly having trouble with something
Listening
Tay
Tay
and mocking me then kicking me isnt helping me.
14:36
Your trouble is listening
Tay
Tay
Im listening, I go to EVERY link
I go to EVERY site
@Tay please take a couple minutes to review what was said
Tay
Tay
and this is usually the crap I see
even if you have read stuff, read it again
Tay
Tay
But if its something I cant even physically do?
14:38
You can't listen?
Tay
Tay
How am I supposed to learn if I cant even see the damn site
you cannot expect for people to help you if you are going to be rude and yell at them
@Tay that isn't our problem
Tay
Tay
Im yelling because I have 3 people scolding me over things I cant help.
if you are unable to view at school than wait until you are home
we have said this countless times
Tay
Tay
Im tired of waiting until Im at home. At the end of the day I have platos and work
I try to explain my situation
but..
"Not our problem"
or you get mad at me
14:40
do you understand the concept that we are not payed to be your personal tutor?
Tay
Tay
Rather than just providing a different resource
because you make it our problem by using it as argument here?
yes, because its not our job to help you in a way that can circumvent your school's blocking policies
Tay
Tay
I try finding help here for this, but you guys arent seeing past 1 issue
@Tay End it here please, this is your final warning.
15:10
Joker is here D:
well hello there
@Superiom Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
Hi superiom
o/
Geez, I have one (day-filling) meeting and this is what I come back to xD
15:20
Yeah, I'm gone for several months this is what happens?
It's preposterous
:D
The audacity
Oooh, that tay had a different name before, right?
Taylor Spark?
That's what I figured
15:23
yep
'kay
Hows your day goin so far?
almost over... been in meetings the whole friggin day
oh, you mean someone finally kicked him instead of just ignoring the constant barrage of questions we've already answered before
15:25
just finished my mtg
Different name, same attitude apparently.
Contrary to popular belief, changing a name and profile pic doesn't suddenly make you a different person :D
Shocking, I know
Has anyone actually kicked anyone since I've been gone? 😃
in other news i got flagged and suspended from chat for 30 min for posting the middle finger emoji in the android room a couple hours ago
it wasn't directed at anyone, people were just posting emojis and i jumped on the train a put the middle finger emoji
Is it room owner or mod who kicks person out?
15:28
Hah
RO's can kick people out but a flag + mods are required to suspend someone iirc
@Alex Both can do it
What's the times again? 1,5,30?
Something like that
And afaik, the 30 minute timeout also triggers a mod notification
Still wondering how long before they nuke chat
15:31
hah, as I am new here, I will just observe the conversations from a distance :P
@BenFortune i'll be depressed
@Superiom: don't worry about it too much :P
It's a cesspool and they can't be arsed maintaining it
i wanted to start a discord for us but no one joined :(
We haven't had any new features for like 5 years
15:32
Apply some common sense and you'll be fine
Somebody in my office sounds horrendously sick. Why on earth are they here especially with all the sickness concerns going on -_-
Bar the mobile chat
@Cerbrus Oh okay
@SterlingArcher cause trump said to go to work if you are infected
i sound horrendously sick
but it's just allergies
15:34
a doctor in my country apparently went to Italy, got infected, came back, had a presentation in front of 50 people and had daily patient meetings for a week
💯
so far there's no reported cases in this state... but it's just a matter of time
2 in NC already
I doubt we'll be affected by it much, most of the state is rural
There are doctors claiming that eventually everyone will get it, just like any other flu.
and it will get rid of the boomers
good riddance
:)
15:36
If we only acted rationally to risks, we'd be okay. But irrational actions, driven by fear...
lol @ this convo
@Cerbrus if you wear a bottle of corona, do you get the corona diagnosis? It should be because you have it!
get out
I just got a message that a classmate of one of my brother's daughters has been tested positively...
Kids getting it is scary, because their immune system is so much better than ours
that's a long relation chain
15:40
Sure, they live in a busy city on the other side of the (small) country, but still.
wtf, are you a boomer Ben? you're like 25
your immunity is at its apex
@BenFortune Why is that scary? Kids are not likely to die from it
Statistically it's not that bad
like, at all
15:41
@BenFortune We don't die
gawd
give me the highest fatality rate virus already
You already have it, weeb
reporting u
Oh, apparently it's the kid's mother who's ill
not the kid itself
At what point to you exit the age defined as "kid"
18?
15:46
30
That's the general age, yes
18
Oh, they're 8-12 ish
@KevinB thats specific
yeah but boomers still refer to 20 year olds as "kids"
@SterlingArcher zubat, zubat, seedot, zubat + linoone, unfezant, numel, unfezant, tepig, sexual harassment, soonâ„¢
2
16:09
although, my initial guess was gastly
if Chuck Norris says it's pikachu, it's pikachu
Tay
Tay
16:34
jsfiddle.net/SirCode/6jsc0f2h Why isnt remove event listener.. removing an event listener :0
@Tay the listener needs a named function, otherwise it doesn't know which context to remove
Tay
Tay
but, what should I use, the function Im originally adding to is relative, or inline, whatever its called.
A named function
Tay
Tay
but... im using an unnamed function...
so... now what...
He's telling you to use a named function
16:38
Change it...
See what I mean about you not listening?
Tay
Tay
change the first one too?
Try, and google :)
learn from failing
Tay
Tay
Ben ffs, he didnt mention the addEventListener, and changing that one
remove listener requires you passing the listener that is to be removed. the docs show that.
Tay
Tay
16:39
Stop assaulting me socially XD
Stop not reading the docs XD
4
RTFM and you won't get abused. Play stupid games, win stupid prizes.
Tay
Tay
Sterling, I appreciate the help, but all ya had to do was say "Change both events to a named function"
I thought you meant make a named function out of the removal listener. context of words changes a lot
Remember, anytime you start a sentence with "I thought", you're automatically wrong.
Tay
Tay
But thats my interpertation of what you said.
Anyways, ima go back to my work
16:45
@Tay the issue here is you refuse to research. stackoverflow.com/questions/4950115/… this is the 3rd google result of "remove anonymous event listener"
And this is a constant thing from you, along with from what I see, yelling at the chat. It's genuinely a miracle people still want to help you -- you literally haven't changed since my chat break.
And i've been gone a long time.
Tay
Tay
damn, it didnt work the way I thought it would. It now no longer holds down the event listener and draws, and instead runs the function once
without mouseup
...
i can imagine the mistake you made, and if it's the one i think you made it's the same one you made last week
No. He needs to try for more than 3 minutes to solve something on his own this time
Tay
Tay
Yeah, it probably has to do with how Im only sending one function call, the mouseclick locaiton...
not the mousemove location
sigh
Alright, I changed the event so its not sending the parent event's actual event.

yet its still sending the event once, not continually.
16:54
I don't see any debugging. Where are your console logs?
Tay
Tay
I already tried logging the console
I know its functioning
The issue is
the event is not recursively calling itself
as it was when i was using an unnamed inline function
using a named function is whats causing this mess
this is one of those things console.log cant solve
no, it's how you're using
Tay
Tay
what am I doing with it wrong. I thought I set the event handler correctly
Actually, seeing as I just used the console to fix your code on my end with 2 changes... I'd say it's entirely the right way.
You're close, actually. The event parameter is passed implicitly to the handler
So change the methods to function references, and try again
Tay
Tay
I wanted to contain the function in the class
is this yet another of javascripts flaws...
16:57
Do you know what a function reference is?
Tay
Tay
Pretty sure its just calling the name of the function
functionName(arguments);
A function reference has no arguments
Only implicit arguments.
Tay
Tay
omfg... its like an interval... ffs Ive been doing that forever.. and I just realised it
Don't ask if it's another JS flaw, that's very condescending to those who's careers are built on it.
Especially when you don't understand the language
Tay
Tay
Ive done function references before... and in event listeners... I guess getting away from programming this weekend for my bday has really killed my brain
@SterlingArcher Excuse me then, Im just mentioning that sometimes javascript has issues on calling something in different forms.

The less rude way
17:00
What do you mean calling something in different forms?
Tay
Tay
its hard to explain, and I dont really have an example, but I know Ive had times where javascript has issues with a function depending on what form its in
like, when a function is an arrow expression variable
or a class method
but it works fine as a function constructor
I believe you're referencing lambda functions and how it handles the bound scope
You should read up on that, it's a great topic
Tay
Tay
listen, I know I dont really know the terminology for things, but I get the concept
thats why I have lots of trouble here
you guys say stuff sometimes that I have no idea of
And do you take that term, and google it when it's said?
Tay
Tay
usually
17:04
You realize it's hard to help somebody that isn't using the correct terminology, right?
Tay
Tay
Yes
And do you think you should slow down your questions, and try to do enough research to use said correct terminology, so you can get the best help instead of 5 people not understanding your question?
Tay
Tay
Well, I would like to know it
but, I cant just learn every JS term in a day
That's why we keep insisting the term research on you
Tay
Tay
So Im coming across them as I learn
17:06
Here's my challenge for you. If you understand the concept, you need to know the terms.
You know how anonymous functions and arrow functions work but you can't name them? That's a fix it point
Tay
Tay
I what functions and arrow expressions are
However, how could I know calling a function with or without arguments has its own term
Those are types of things that I become oblivious to
11 mins ago, by Sterling Archer
Do you know what a function reference is?
Hence why I asked this
17:24
Wa'd I miss?
17:45
It would help if you'd hit that "tidy" button in your fiddles every now and then, @Tay.
17:57
wait, did he actually do the setTimeout(foo(),n) thing again?
he literally did that last week
@KevinB wrong event context
Tay
Tay
-@Cerbrus I hit tidy after every save...
Im very anal about that
If you saw something untidied, you managed to see an old save
@SterlingArcher yes, but I wouldn't describe it this way
Hm, I justy loaded the last fiddle link
Tay
Tay
Check again, its still tidied on my side
I set as base again
18:03
It's the difference between calling a function and a reference to the function itself
Tay
Tay
and it works now
the arguments aren't really relevant
Yea, not tidied
Tay
Tay
Bs
show me tidied on your side..
but please dont tell me your one of those people who return every statement...
Sheesh
Tay
Tay
18:04
like... some people are like...
Calm the frick down
Tay
Tay
if (
  blah blah
)
calm? Im calm...
what?
wut ,_,
@Tay This is very uncalled for
> bs ... don't tell me you're one of those people ...
Or calling it BS
18:05
that. it helps nothing. stop doing that
Tay
Tay
._. Alrighty then.
Untidied.
Tay
Tay
"Image not found"
Dont screenie
Also, you yourself claim you don't know JS so you have no context to continuously call people out for stuff you don't know about
Get a proxy.
Tay
Tay
18:06
its a school laptop, nty
Id rather not get in trouble
oh its 2:06 actually, I leave at 2:10
Is this school work?
Tay
Tay
like I even have school work rn, I complete my stuff ahead of time.
Else I wouldnt be able to code this much
morning
@Tay yet you program when your not supposed to
Tay
Tay
morning.. wait... wut
18:07
@Cerbrus lol
morn unbreach o/
Tay
Tay
@JBis Again, Im allowed to in this particular class
theres only one class that dislikes it
no idea why, all my grades are above 90 rn
This is annoying
Like we rehashed over and over again, either get a proxy or stop complaining about not being able to see shit.
If you ask us to show you something, expect an imgur
Tay
Tay
I have to go
18:08
this is getting out of hand haha
If you don't want that, don't ask us to show you shit
Tay
Tay
2 minutes
If I see you whine about that again, I'm kicking.
Tay
Tay
anyways, cya guys, and please dont get mad anymore. Im not mad, so none of us should be
We're mad at you not listening, it's one sided.
18:10
From now on @Tay, whenever you ask a question that has been answered before you will receive a one min suspension.
if I'm on I will enforce that, I encourage others to follow
ben's suspension seemed to be effective temporarily
It's alright @Tay just try to do more research on your own first
18:45
@Sheepy But how do I bind events to those elements?
Do I need to do document.getElementById() again and then bind the required events?
if you don't have a reference to it, yea, you gotta make one.
How about this?
var root = document.createElement("div");
root.innerHTML = "Some HTML string";

root.getElementById("myElementToFind");

someElementInDOM.appendChild(root);
that would work, but, given you're working with an ID, that just as well could have been document.getElementById since there's only one element with that id.
This is better than appending the HTML string in the DOM and then looking for my created elements, right?
Yes, exactly. You are right
oh, i see what you mean. it isn't even in the dom yet at that point, right?
18:51
Yes
My ID could conflict with some other ID in the DOM
The other users would be embedding my Library
I could generate a unique ID
A random one
What do you say? :)
i would avoid using ID's in situations like that
Use classes?
That was just for an idea
Finding an element inside root element would be faster than finding the element inside the entire DOM

« first day (3432 days earlier)      last day (1740 days later) »