« first day (3322 days earlier)      last day (1612 days later) » 

1:13 PM
Hi Guys, I have js question
 
@PooyaPanahandeh 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.
 
I have a task to do which I must make change on some div tag, but I can not access them through the Id or class, the only way I have is using following line:
document.getElementsByTagName('span')[1].innerHTML = "something"
my question is, how can I set variable for this line?
 
What variable?
 
```
var x = document.getElementsByTagName('span')[1].innerHTML = ' something'
```
is there any way for it
 
What should the value of that variable be?
the element itself, the innerHTML of the element or the string 'something'
 
1:20 PM
let's make it clear, I have several boxes, and the only way I can change their displaying status is accessing them by the value they have which called caption and it's a inerHtml value, now I need set variable for example x(var x) to the specific innerHtml tag, then I would be able to change their display
 
var x = (value) => {
    document.getELementsByTagName('span')[1].innerHTML = value;
}
that way?
x('test');
 
use document.querySelector('span')
its shorter
 
@BenBeri first time i see that transform origin. so, TIL
 
Um... why are you trying to turn a variable into a function
just use a function then
 
idk he said he wants it as a variable lol
 
1:23 PM
function x(v) {
 document.querySelector("span")[1].innerHTML = v;
}
lol okie dokie then
you-do-you-boo
 
^ invalid syntax
 
yes, I forgot the name lol
You can still write un-specified functions like that using variables
 
ben Beri, invalid syntax, Because it says it's not a function
 
there, with that function you could write x('test');
 
then you can do what taylor said or do var x = function(value) instead of arrow function
 
1:25 PM
Why would you specifically want to write a variable as a function
The only time thats necessary is when your using "this" statements in methods
 
promise you will never cheat on me again
 
@TaylorS querySelectorAll*
 
.innerHTML = ...someString... is bad if the string is not a part of the document tree
 
oh right lol
I forgot that i never select bulks of elements
Unlike most people who use arrays of elements using like getElements or something simular, I prefer just selecting one
it also depends on the situation and project environment
 
Is Dart rly going to be on browsers?
 
1:28 PM
Depends on if they implement it or not.
 
think that mozilla, edge and rest browsers will follow google's plans lol
it's alot of work
 
still has a same error, should I clear dom event after each time I am runing?
@KarelG do you have any way on your mind
 
.textContent or innerText
innerHTML is telling your browser to re-parse the entire document
 
function x(value) {
 document.querySelectorAll("span")[1].innerText = value;
}
 
that is just bah
 
1:30 PM
Try that
 
There is an interesting leaked email here on what Google planned for Dart (called "Dash" back then) @BenBeri
 
or do you REQUIRE IT to be a variable
 
@PooyaPanahandeh tbh, I am not 100% certain what you expect :)
 
if it requires to be a variable, this should be sufficient
var x = function(value) {
 document.querySelectorAll("span")[1].innerText = value;
};
 
so I am just sitting here figuring out or letting others stabbing around in the dark until someone got the answer you want
 
1:31 PM
No idea what they are asking for
 
why are you proposing answers then?
 
@TaylorS it works, thanks a lot
 
@KarelG Because he might be right :D
 
@KarelG Because it's stackoverflow, not normal forum
 
I hated Typescript so bad. So bad that I didn't even want to hear about it. I was scared to even look into it. I hated it' so badly, I said I will never ever learn it.
But today? I only use typescript. I hate plain javascript
True story boys
 
1:41 PM
> I hate plain javscript
that's the part I can follow and support :)
 
I mean if you really want to show someone how really ugly code looks like
show him a compiled version of typescript to js
 
Why not just show him the compiled assembly code?
It's way uglier.
 
lol
 
I mean, if we're showing people compiled binaries, why not go all the way?
 
I bet assembly looks better than this i.imgur.com/G9qu3JC.png
 
1:44 PM
@BenBeri Seeing how assembly code looks roughly like
\00\00\00
IHDR\00\00\00\CC\00\00\00(\00\00\00\B2\F7f\00\00\E1IDATx^\ED]TT\D7\DDC\EF(\88bjlE\8DIL\8C~ (\D8@\8D)6l\DF\8D%[\AC\B1\A31\96\AC\9F\9F\9F\D8\CD'1V\D4\8D51vQ U:\CC_\FB\EA\87y3\CC \CE\F33g-\96\C0\BB\EF\DC\F3\CE;\FB\EEsν#
\A5R\A9\C4S9p\E0\00N\9E<\89k׮!--M\FA\B5\E5߿\80\A6\DA[ޗ)_\93\B5\BB\AAՀs\93`\B8\BE\FA\B6J\B5\82\80INN\C6ڵkq\F1\E2ES\CEi\D1U\86\98j\9F^\86\B3\FD\BD\A6r\AC\F3|\DE\9B
>\80\99>}:\AE\\B9\F2\F7\F2\C2\FF\D9\D3Z\00c\DE\EAP ~c\A1\88\8F\8FW\AE_\BF޼\B3Y\B4\9B\DD\C0\98\DD\C5\F0\EEELL\8C\F2\FC\F9\F3\E6\9F\CD2\83Y=`\8CY\DD+\94;6\80bȐ!\CA\F4tK\FEk~w
I disagree.
 
Looks good
xD
 
@MadaraUchiha Please don't post unformatted code here. Press Ctrl + K a- oh, nevermind.
 
rofl
so ugly that it cant even be formatted
 
just throw it in ```
 
@MadaraUchiha did you just randomly press random characters in Hebrew while being in notepad, saved it as ansi , re-opened it and c/p it over?
 
1:49 PM
@MadaraUchiha אתה מכיר את הדוגמנית מהיפהבה?
 
Use IDA or something to dissasemble the Assembly
 
@KarelG No, I opened a PNG file in gedit and copied some section from that
 
I use it to break up IOS assemblies and steal operaters to hack in-game values :3
Oh...
 
@TaylorS Aye, I sometimes do that with Cheat Engine
 
its from an image
I remember the good old days when everything was hackable by cheat engine
then Easy Anti Cheat appeared :P
 
1:50 PM
Find the address for money value, find what movs to that, go one opcode up, change the sub to add, boom, get money every time you buy stuff :D
 
lol yes
 
That still works on every game I cared to try it on
Even on ones with anticheat (not on online games, obviously)
 
I did it old-school, I loved finding the Pointers like that, but sometimes... I just used Wildcard Searches and hex Arrays to find the value in seconds
then change it
 
eh png
 
you can use LUA and an array of Hex Octals, along with wildcards (?) to representing inter-changing values, and you can tell it to send the address back to the cheat-table...

then automate it into a LUA script, and have it automatically find all your addresses every time you open the Cheat Table
I really should get back into cheat engine lol
 
1:53 PM
it does not work always tho
 
Eh, Depends on the length of the array
 
those memory addresses often get changed after each update
 
Longer, means its more precise, but more easily broken
I on average used a 5 octal array
 
(different build) and if the devs does it right, it can differ at each game launches
 
so basically like 5 lines of 10 octals
 
1:54 PM
but I don't think I have seen a game that does that last one. My company's application does it tho
 
and then researched the same octal over and over, restarting the game, filling it with wildcards, until your plainly able to search the octal and get your single value instantly
 
I never got anti cheat for single player games
 
Yup ^
 
Dude wants to cheat at the game by themselves
Good on them?
 
used to love cheating single player games, but most games have multiplayer or some kind of EAC integration or other powerful anti-cheat
cheat engine is basically a rust bucket for older single player games nowadays :(
 
1:55 PM
it is their own games. I don't care about it as well. But I see sometimes bashing on forums where user X wants to have indefinite hp to get pass that boss
 
Hell, i even made a cheat table for like... Lego Star Wars, the Complete Saga...
like that old..
 
I just do "grab a trainer"
but some are "oh lolz u cannot beat game. Boss is easy" ect
 
@KarelG Then those forum bashers are idiots
Some people just wanna progress through the story, or have a relaxed playthrough
 
yeah, most people just google a trainer and the skilled programmers out there that make em just give em out free
dont even get me started on WEMOD
 
I watch the spiffy brit on youtube sometimes. He does these videos where he shows common ("legitimate") game exploits
 
1:56 PM
new tech gods out there that make hundreds of latest up-to-date trainers for steam games, they have a custom engine and everything. Seriously the game hacking community is almost as upheld as the gaming community itself
sigh remembers the age of cheat codes and hitting save disks to cheat on games
 
My favorite was Fable where selling a different kind of item in your inventory after the first got confused with the first, letting you actually make the game think it had a large number of a certain item in a store
you could effectively abuse that and make massive profits by selling cheap items and selling them as expensive items
 
Probably my favourite cheat was for terraria... exploit the contact system, and your able to noclip
along with tricking the game into thinking your wearing wings, and setting fly-time to 280 or NOPing it
basically fly through the world infinitely
 
@MadaraUchiha it is a "shame" nowadays to play the game on easy mode and then I see eg. on Steam some complaints about the difficulty of the game. Lowering the difficulty was not an option. I was like this
 
the guy is brilliant.. not sure where he gets all his info from
but I'll watch his videos for games I don't even play
 
You should meet DiDA..
 
1:59 PM
he probably snoop'ed in the code :P
 
@KarelG As in, they didn't want to lower the difficulty, and complained about the difficulty?
 
Hes like.. the ios hacking GOD of everything
 
yes
 
Madara your on iOS Gods right?
 
@TaylorS I am not.
 
2:00 PM
Ooof.
 
I think you asked me this before.
 
oh yeah I remember
Well, Anyways, its a forum.. of like... thousands of people that make ios cheats from Assembly Code and from Arm-Injection
Thats what I love about iOS... using ARM cheats to instantly exploit any function
without even needing to program
 
I don't generally play mobile games
 
if it were up to me, every game would have an easy/relaxed mode, a "normal" mode (as developers intended it to be played), and a near impossible mode with achievements for each
 
you can cheat on other platforms as well
 
2:01 PM
@KarelG I do cheat on other platforms if I feel like it vOv
 
@Neil tbh I am not fan of that achievement thingie
 
Usually it's after I beat the game, but not always 😃
 
😛
 
if you're doing it to say you did it, you get an achievement only through difficult play, but also casual gamers can just play just to play
 
@KarelG You're not an achiever
 
2:02 PM
Well... on iOS, you can use the ARM Applications to "extract" all the Methods and Functions from the app's executable ON THE DEVICE... and then instantly just change values, enable the code, and it instantly refreshes the app with the cheats
 
bah :P
 
There's this sorta unofficial breakdown of gamer types
 
Ya dont find cheats like that on PC
 
@KarelG it's supposed to be just that, an achievement
 
achiever, completionist, killer, socializer
 
2:02 PM
I usually play the campaign once
then cheat forever
 
socializer that's totally me.. not
 
Those who are in it for the medals and progression, those who are in it for finding secrets, those who are in it for the PVP, and those who are in it for the social aspects (trading, raiding, partying, etc)
 
I like Social Aspects, but I also just love building, or finding secrets
 
@MadaraUchiha is there not a type of gamer that's playing it for the actual game?
 
@Neil That's a given
But what draws you to a game?
 
2:04 PM
I don't think any of those really reflect my playing style in most cases
 
What's the heuristic you use when picking this game but not that one?
 
I like seeing a game with the ability to Create and Destroy Equally
Minecraft or terraria are good examples
 
I enjoy the optimization of a character, or improving game style, but I don't want an achievement or to complete all side quests either
 
Also s/completionist/explorer/
 
Card-life... and unfortunately... I have to admit roblox does also fit in the category
its just so kiddy and toxic..
 
2:05 PM
also depending on my mood, I can also be quite the explorer
but not always
 
Im kinda sad I cant work on visual studio at school
making javascript projects is fun, but Im kindof bored of webdev right now, want to continue work on my Analog Clock... I was making an animated clock
 
I love that you used "What's the heuristic" in your question
only IT peeps would get that
 
Heuristic? That word is anoyying to me because my antivirus thinks every little uncommon file is a heuristic file and deletes it..
Like a simple little C# form is considered a virus... and I cant exactly remove it
my dad payed for the antivirus
But I shutdown all its anti-virus software already.. now its just an annoying notification system that pings me all the time in the bottom corner when something is suspicious
 
AV's does not auto-delete files.
 
Norton does
 
2:09 PM
nope. My mom has it.
 
"Detected Heuristic.gen.05" "File is unsafe and has been removed"
And I have to manually go in an restore it
 
that is just their saying of "putting in quarantaine"
 
> You keep using that word. I do not think it means what you think it means.
 
Ive basically made folders in my desktop where I install all my programs so norton cant detect it
 
non-tech savy people panics easily if "quarantaine" is used
 
2:10 PM
that was an awful choice of words to use
 
People nowadays panic if virustotal says 2/68 engines found XD
 
you only have to "whitelist" a folder via norton security center
 
Yes thats what I did
in the settings
 
Yes it is sort of a "file quarantine", but mostly it's just moving the file into a folder where it can't be used
 
lol antivirus
 
2:10 PM
I blocked its access to my Desktop
 
Don't think I had antivirus on any of my machines in the last 15 years
 
So it cant touch my sketchy shit I download
im not an idiot though, Im not going to just download a mysterious exe from any place, and I havent had a virus in 3 years
 
neither do I Madara. I just tell people that the window defender is sufficient enough and that spending money on AV suites is a waste of money
you get definition updates for that defender anyways, even if you disable it
 
When i was younger though, I installed a botnet in my mothers macbook downloading minecraft mods.. The anti-virus detecting over 2500 infected files lol
 
Antiviruses are shit, they generally do more harm than good nowadays, especially on tech savvy people's machines.
 
2:12 PM
Pretty much Madara
 
so technically you have two sets of definitions on your pc.
 
Im considering removing norton, im not the one who pays for its subscription
 
(AV companies often share virus definitions in between each other)
 
like Virus-total, which is an online file scanner, it shares like 70 AV definitions for scanning for engines
oh, Switching to my next class in IT... gtg
Gunna go finish my lego robot arm :3
 
byeeee
If someone annoying asks you for a good free antivirus, suggest Avast. You can only uninstall it if you uninstall your entire system. That stuff hooks into literally everything and you can hardly get rid of it.
 
2:14 PM
yep
can attest to that
Took me ages to completely remove Avast from my father-in-law's system
 
Geisterfurz... Have you seen the Razer Software..
It took me 2 weeks to get every last bit of it out of my computer... then about 2 months later it just reappeared
 
Hey guys, I know that if I want multiple spaces to be shown as it is, I should use &nbsp; instead of normal space. But if I stil wanna use normal space, is there any css property to treat it like nbsp?
 
@RahulJain white-space: pre;
that means, white spaces are shown as is
 
@Neil I tried pre-wrap, but the thing is if there are a lot of whitespaces in the end, it will never go to next line
Go to https://draftjs.org and type all whitespaces in the text-editor.
I want it there
 
2:30 PM
@RahulJain It won't newline on account of spaces
you'll need to add <br /> tags to force it
but probably better to just create padding
 
But in nbsp case, it does, right? I want the same behavior
 
@RahulJain if you hold down the space bar, you'll notice it won't go to the next line until you type something else in
 
codepen.io/anon/pen/VzygbV check here (with nbsp, it goes to next line)
 
2:44 PM
@RahulJain on a web page space is &nbsp;
there's no getting around that
 
@Neil so I need to use nbsp only?? ugh lol
 
I think that may not be necessarily true for an input of type text
but only because the value is inside the value attribute
but you'll have to use textarea for multiple lines
or an editable div or something
 
@MadaraUchiha Antimalware programs (a slight nuance) work well I think. I use Malwarebytes and it does a really good job and I see absolutely no performance impact.
 
@JBis I just use Ubuntu vOv
 
I mean for the most part its not necessary if you are teach savvy unless you are downloading sketchy things
You use Ubuntu as your main OS?
 
2:56 PM
Yes.
 
Nice.
 
who doesn't ? :P
 
I use macOS.
 
my work env OS is Windows because of work says so <.<
but le me coding at home: ubuntu
or debian for server shizzle
 
Because i get the best of unix but also some extra features that works nicely with my other apple products
and since its unix 99% of the things i can do on ubuntu i can do on macos
 
3:00 PM
Like a keyboard that you have to google for where the goddamn braces are.
 
@RahulJain pre-wrap or pre-line
 
3:47 PM
<div> <!-- parent -->
    <div>
        <span>Data is Here</span>
    </div>
</div>


documnet.querySelectorALL("span")[1].innerText = 'Data is here'



can i change the div parent by accessing to the span tag???
 
@PooyaPanahandeh Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. 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
 
@PooyaPanahandeh .parentNode gives the parent
you need to do it twice to get that first div
 
By changing I mean style.display = none or block
@KarelG Thanks for your help
 
 
3 hours later…
7:09 PM
Hi there
 
@GabrielDube 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.
 
one of my variables in my javascript code is coming out as blank I'm not sure why
<script>
 var validationError = document.getElementsByClassName('input-validation-error');
 if (validationError.length > 0) {
 } else {
 document.getElementById("CheckoutButton").onclick = function() {
 var totalAmount = document.getElementsByClassName("js-cart-info-total").innerText;
 fbq('track', 'Purchase', {
 value: totalAmount,
 currency: 'USD',
 content_type: 'wiperblade',
  });
  }
}
</script>
 
what variable is blank?
 
the totalAmount variable is blank
 
Run console.log(document.getElementsByClassName("js-cart-info-total").innerText) in your console. Whats logged?
 
7:12 PM
undefined
the collection returned by document.getElementsByClassName("js-cart-info-total") has no innerText property
 
the html where im pulling the class from is <td class="js-cart-info-total">total</td>
Maybe my syntax to pull out total inside of <td> is wrong?
 
well, no, the key word in my message is "collection"
you're getting a collection, aka a set of elements that had that class
even if it's just 1 element, it's still a collection, not an element
 
Oh okay
 
if you want properties or attributes of a single element, you'll have to reference that element from within the collection. for example, document.getElementsByClassName("js-cart-info-total")[0] to get the first one.
 
can I still do innerText?
Or is not necessary?
To get <td class="x">this text</td>
 
7:18 PM
use queryselector. Your life will be easier
document.querySelector('.js-cart-info-total').innerText
@GabrielDube yes, have getting the 0th element you can
document.getElementsByClassName("js-cart-info-total")[0].innerText
 
Awesome!
I'm going to try it now
Worked perfectly
What is queryselector for?
I'm interested lol
 
it finds teh first element that matches teh selector
 
7:45 PM
Thank you so much
 
@GabrielDube look at the mdn doc
|| mdn document.querySelector
 
|| mdn querySelectorall
 
Does anyone know how i can make a native node module in objective - c or swift? I am confused how I can connect a native library on macos to node.
 
8:09 PM
I have three table user, post and comment, post and comment are associate, post is a parent table and comment is a child table that has postId references post table, my problem is how to I insert a postId into a comment table where I have postId field, . Please anyone who can help me.
 
@mchomvu 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.
 
@mchomvu Are you asking how to interact with a db in node.js?
 
yes i have posted the question and ask the help but i have not get any respond yet
@JBis yes i have posted the question and ask the help but i have not get any respond yet
 
what type of db? mysql? sqlite?
 
@JBis I am using Mysql
 
@JBis i don't have any problem with connection, I luck a logic on how i can send the postId to comment table where i have the field of postId as it references id from post table
 
So is your question about SQL? I'm not understanding
 
@JBis kindly can you check the question i posted?
 
can you post link?
 
1
Q: How to I insert an id of associated table into a database

mchomvuI have three table user, post and comment, post and comment are associate, post is a parent table and comment is a child table that has postId references post table, my problem is how to I insert a postId into a comment table where I have postId field, below is how I have tried but it did not wor...

 
8:36 PM
@JBis have you see it?
 
ill take a look in a bit
 
@JBis Ok thanks
 
9:20 PM
 
 
1 hour later…
10:34 PM
Hi I need to set EVAL function for iMacro to get words from 7-20 position. But I don't know how to do that. I have this code but with this I get just one word. Can someone give me some direction how to do that? This is my code SET !VAR1 EVAL("var s=\"{{!EXTRACT}}\"; s.split(' ')[7]; ")
 
@Pijes 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.
 
well I can't help you with imacros' dsl
but if you make a JS example I could help with that
 
@forresthopkinsa Thank you. I don't have JS for this
 
well I should probably remind you that this is, in fact, a javascript room
and you've got a little bit of JS in there
 
Sorry. I was think that this is java script. I don't have to much experience with JS and iMacro
 
10:38 PM
I have zero experience with iMacro
that looks reminiscent of a Velocity template
 
If you can delete it please. Sorry again
 
no worries
it doesn't need to be deleted, I just don't know anything about iMacro(s?)
but you said you want words from the 7-20 position
can you explain what you mean?
||> var s = "one two three four five six seven eight nine ten"; s.split(' ')[7];
 
@forresthopkinsa "eight" Logged: ``
 
note the output of that code
you're on the right track, but s.split(' ')[7] is only going to give you one of the words -- the eighth one. Why the eighth one? because arrays are zero-indexed
 
Yes I get text and want to save just from 7-20 words.
 
10:41 PM
@forresthopkinsa "one" Logged: ``
@forresthopkinsa "eight" Logged: ``
 
||> var s = "one two three four five six seven eight nine ten"; s.split(' ')[0];
 
@forresthopkinsa "one" Logged: ``
 
okay
so you want a subset of the array of words
let me show you:
||> let arr = ['a', 'b', 'c', 'd', 'e']; arr.slice(2);
 
@forresthopkinsa ["c","d","e"] Logged: ``
 
that's what you're looking for
now let's work backwards
||> let str = 'one two three four five six'; str.split(' ');
 
10:43 PM
@forresthopkinsa undefined Logged: ``
@forresthopkinsa "SyntaxError: Illegal return statement" Logged: ``
@forresthopkinsa ["one","two","three","four","five","six"] Logged: ``
 
Thank you. I will try that
 
right, you want to do slice(6) instead of [7]
||> let str = 'one two three four five six seven eight nine ten'; let arr = str.split(' '); arr.slice(6);
 
@forresthopkinsa ["seven","eight","nine","ten"] Logged: ``
 
^ there's your answer
 
Thank you again
 
10:47 PM
no problem. let me know how it goes
 
Hi I don't know what to do with your code. I converted my code to JS to show you. pastebin.com/CPKvHLQB Can you help me with that?
@forresthopkinsa Sorry I didn't mention you.
 
hey my bad
what output do you get with this code
 
Just some text
 
show me the expected and the actual output
jbis do you know anything about imacros
 

« first day (3322 days earlier)      last day (1612 days later) »