« first day (3195 days earlier)      last day (1757 days later) » 
00:00 - 14:0014:00 - 22:00

12:01 AM
In html, the most parent thing is DOM that we can get hold by 'document'
what is the most parent thing in Nodejs?
In Java, we have Object object
 
not the same thing
Node has global, which is roughly equivalent to window
 
is there some documention on this?
documentation*
 
thanks
 
Java Object is an entirely different thing
it's not a scope at all, it's a superclass
 
12:04 AM
yes
 
hi
Am I doing something silly here with the .map? It returns null although the state I pass in is not null its an array of values
var tableRows = this.state.localTableState.length
  ? this.state.localTableState
      .map((row, index) =>
          <tr key={index} data-item={row}>
            {/* filter out columns not not in props.tableHeaders */}
            {Object.keys(row)
              .map((key, index) => (
                <td data-title={key}>{row[key]}</td>
              ))}
          </tr>
      )
  : null;
  console.log(JSON.stringify(this.state.localTableState) + "localTableState in Table");
  console.log(tableRows + "table rows markup");
 
 
2 hours later…
DRP
1:55 AM
Hi Team,

Need some help in understanding node global vs local permission
If I use nvm this is global to my understanding
However a command like this npm install --save ethers-cli will give me error access
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib'
WIth the G knob it did work : npm install -g ethers-cli
sudo keeps flaggin weird stuff
 
 
4 hours later…
6:31 AM
@DRP You have to add -g to nvm command if you want it global
otherwise it will attempt to install it in ./node_modules directory relative to your current project directory
obviously if you don't have permission to create a local folder and add new files/folders in it, the command will fail
 
 
1 hour later…
7:39 AM
Hello Anyone can help me with Routers in react js
 
@Amnahkhatun 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 am getting this error TypeError: Cannot read property 'push' of undefined
when I am trying to route to a different url. Here's the link to my question
https://stackoverflow.com/questions/57050533/unable-to-navigate-on-click-of-a-link-getting-error-typeerror-cannot-read-pro
 
You do not need the function.
As long as you don't do anything else but navigate in the handleClick method, there is no reason to have it.
<Link style={{ color: "#e73a9e" }}
      to="/editable-table"
      aria-current="page"
>
 
I tried the same thing didn't helped
 
Did you keep the onClick function defined in the link?
 
7:46 AM
No
 
webpack + jqueryValidate + additionalMethods anyone has faced it?
 
1 message moved to Trash can
@Amnahkhatun 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 gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
 
import EditableTable from "./AdminJobseeker/components/EditableTable/EditableTable";
//import { connect } from "react-redux";
import { Switch, Route, BrowserRouter } from "react-router-dom";

export class index extends Component {
  render() {
    return (
      <BrowserRouter>
        <Switch>
          <Route exact path="/editable" component={EditableTable} />
        </Switch>
      </BrowserRouter>
    );
  }
}
 
Add another Route: <Route exact path="/" component={JobSeekerMain}/> Basically the same stuff that is done in the answer that is posted. What didn't work with it?
Also as noted in the comments below that, make sure to use the Link component from react-router-dom and not material-ui
 
After trying above way I am getting this error
Error: Invariant failed: You should not use <Link> outside a <Router>
 
7:53 AM
Your link is not a child of <router>
 
Did you add the Route in the Switch?
 
Sorry I am pretty new to react js, what does it exactly mean adding route to switch
 
You posted some code that contains a BrowserRouter a switch inside of that and a Route inside of that, right?
 
Add the line <Route exact path="/" component={JobSeekerMain}/> either above or below the other Route inside the switch component
 
7:59 AM
Added still the same issue
 
Hey guys !
I'd like to know if there is a better way to do
 v-if="gallery && gallery.photos_count > 0"
Like in react ? {{ gallery?.photos_count > 0 }} ?
 
how to deal with legacy jQuery plugins in webpack?
 
@Amnahkhatun What is the URL path (I don't need the host if you don't want to disclose it)?
 
I mean ones that do .extend jQuery
 
@Raimonds Are they on npm?
 
8:06 AM
localhost:3000/ or is there anything after the slash?
 
It just seems I am getting new instance of jQuery all the time.
jquery is, 3rd party ain't
 
You will have to either inline the 3rd party library, or use externals for both jQuery and it.
 
what do you mean by externals?
 
I don't quite get it, but is it a case where I make jQuery as external so whenever something tries to access it it will use that single instance?
 
8:16 AM
mornings
i'm trying to use java script to update html table using js and custom inputs
but i don't know how, can anyone explaine me pls
 
yours first step will be learning the basics of JavaScript.
 
and next?
 
You will learn how to update an html table using js and custom inputs :P
2
 
^
 
The general idea is the following: Get the input field, get it's value, get the table, get the table cell, set the value.
 
8:20 AM
a good start is using an online page such as developer.mozilla.org/en-US/docs/Web/JavaScript or some javascript books
eg eloquentjavascript.net which offers both digital (free) / physical work about JavaScript
 
@geisterfurz007 ya you got it, but when i do that it makes the table look like:
 
Given that I have no idea how it should look instead, I say that doesn't look like a bad table.
 
@KarelG tanks, i will see that links for study
@geisterfurz007 like the query shoud filter the rows from the first table and not show above the table
 
Oh! The top table shouldn't be there?
 
@geisterfurz007 the fields I'm looking for at the top should refresh the first table that is in the image with the pagination, but instead it causes a new table to appear below what is not correct
 
8:29 AM
Yeah we can't tell you what's happening without an example or code.
 
ok, i'm going to upload some code as exemple it's ok?
@BenFortune here is the table code : paste.ofcode.org/36GKHSWXfzuLVLTG3HGhMm2
and here is the query code exemple: paste.ofcode.org/McS2jHzDWTRnaauXgHDzz6
 
You need to replace the existing table then, and not the div below it.
 
ok remove table and use only the div right? but the pagination don't work
 
('#pedidos').html(dataHTML);
You'll likely need to re-initialize your datatable, since the contents have changed.
Or you could use an AJAX datasource for datatables and let that handle everything
 
the reason I'm doing this is because the serialnumber of products are not in the same table in sql
 
8:40 AM
Hi there
 
have other way to do this?
@AbhishekPandey hello
 
How can I unwrap a array from string.
 
I guess you have code somewhere that fills the table @NoobDEV-GBL?
JSON.stringify? @AbhishekPandey ?
 
{
 "data": "[1,2,3,4]"
}
 
parse*, I am dumb
 
8:41 AM
@AbhishekPandey Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
const thatArray = JSON.parse(thatObject.data);
 
@geisterfurz007 like you can see in the code, i make a first query to build the table
 
@AbhishekPandey That didn't make much sense. Use the !!/help command to learn more.
 
!!>JSON.parse("[1,2,3,4]")
 
@geisterfurz007 [1,2,3,4]
 
8:43 AM
@geisterfurz007 Shit, I also forgot that syntax
that bud
thanks**
 
@AbhishekPandey plse see if this whoud help you stackoverflow.com/questions/25589605/…
 
Probably not because that is swift and not JS :D
 
ya you are right, sorry
 
@NoobDEV-GBL You build your table in the backend, is that correct?
 
8:46 AM
@geisterfurz007 ya i think
 
Yeah, I agree with Ben Fortune. You are replacing the wrong thing.
If the only thing after that is the pagination, see if you can tell that thing to update somehow.
 
@geisterfurz007 ya , but like i told ben, if i remove tha table, and just use the div, the pagination whoud't work
 
You are not supposed to use the div.
Or am I missing something, hang on.
 
okok i understand now, going to try that
@BenFortune sorry, i goint to try your suggestion
 
Yeah, the div is below your table. If you replace the content of your div with a new table, you will have a table below your original table which is exactly what you are seeing.
 
8:54 AM
@geisterfurz007 going to try that
 
9:10 AM
@gei
 
@geisterfurz007 which url path
path is '/editable'
 
I meant the path for the JobSeekerMain
 
That doesn't have a path
 
So it's just '/'?
In that case I am out of ideas, sorry.
 
9:13 AM
ya actually i dont need that at all
 
9:32 AM
Can anyone explain why I can't remove async script with onload event?
<script src="..." async onload="this.remove()"></script>
 
why even
Removing a script doesn't stop the execution of said script
 
or even the presence of the functions/classes/objects defined in that script
you can still call these
 
9:50 AM
Hi, wondered if you can help. Im trying to replace a A with circumflex via JS in google tag manager which is a JSON feed, however i've tried every version of the character going and its not replacing it using the x.replace method. Any ideas?
this is my current code:
 if(titleCheck) {
     clearInterval(clearTimeout);
  	 $('h4.news-title a').each(function(){
          var title = $(this).text();
          title.replace('&Acirc;', '');
          title.replace('&#194;', '');
          title.replace('%C2', '');
          title.replace('\00c2', '');
          title.replace('\302', '');
    });
}
 
@KirstyMarks it does replace (well it should) but only once
 
@karelG its not even replacing it once :S
 
It is, you just aren't assigning the result.
 
!!> 'something%C2in%C2between'.replace('%C2', ''); // should replace the first hit
 
@KarelG "somethingin%C2between"
 
9:58 AM
but as Ben said, you don't do something with the returned value
 
@KarelG any idea where i can read about this? I put in £ as the second parameter and it didnt replace it
ie
title.replace('&Acirc;', '£');
 
> you don't do something with the returned value
 
but obviously the correct code for £
 
title = title.replace
come on...
 
and at the end $(this).text(title)
 
10:00 AM
@BenFortune im relatively new to JS, its not something i know!
 
this updates the text
 
You've been in this room 3 years
 
ok, that makes sense, thankyou @KarelG
 
Probably longer
 
@KarelG any reasons for this code not to work
<script src="..." async onload="this.remove()"></script>
 
10:00 AM
yes! And i've only just got a role where i am learning it!
 
@Raimonds Yes, for the reasons mentioned above
 
you'd be surprised what I now know @BenFortune. This is why i havent been in here due to that kind of words :(
Thankyou @KarelG, i now see what you mean
 
That's one of the first things you learn when learning any programming language. And you didn't know.
 
@KirstyMarks u have ability to block people and ignore them
 
@Raimonds I may do thankyou
 
10:02 AM
That is what I did when he kindly showed his attitude
 
@Raimonds what do you mean with "it does not work" ?
 
It does not remove script tag
I tried it in sandbox enviroment
 
well, that is not how you does it but why? it is an useless operation
 
with CDN for jquery, worked fine
 
@BenFortune forget it! you clearly really want to belittle me! I've just said im in a new role, where i am learning JS alot more. I havent been in here in over 2 years and asking a question where i showed what i feel is a damn site more understanding than 2 years ago yet you still wish to make me feel crap. Thanks mate!
@Raimonds how do i block?
 
10:03 AM
lmao
 
@Raimonds sorted it. Thankyou
 
Pretty sure you're still on our vamps list
 
Left click on face
@KarelG I have code where I am using GoDaddy script tag which basically injects image below itself, but also we have print functionality that take copy of DOM and restores it later
 
at least some people are kind. Yes I used to be in here alot and ask probably silly as hell questions, but christ no reason to be nasty all the time about it... Glad I blocked him. Probably a reason why i havent been in here in so long due to it. I hope he never becomes a manager!
 
something like
var restore = document.body.innerHTML
and later
document.body.innerHTML = restore
basically all script tags that are part of restore executes again
and it spams images all over -_-
@KirstyMarks I believe only reason to be here is to share expertise
 
10:07 AM
I haven't been in here in absolutely years... probably 3. I've just gone in to a heavy JS role and tbh even after 2 months i've learnt a damn lot, and i do understand my mistakes in previous years in here, but surely people change. Yes that may be basic, but when you read the web and they tell you x, and u want to know why, i just need help understanding why. Not a sarcastic AF comment :(
I mean my manager tried this
 $(this).text(text.replace('£5', '&pound;'));
and every thats not working :S
hence why i'm looking at it :S
 
what is text there?
and there are better tools to ampersandify your text
 
@KirstyMarks don't let the sarcastic few ruin it for the rest of us
 
if that is taken from example
than text is like string
I mean, jQuery shows example text.replace
 
if you don't ask questions, you never learn
 
@Neil i've just blocked him. Energy vampires drain me. I'm already head mashed as it is, but christ i just wrote a massive amount of code which i wouldnt have known 4 years ago and that works lol, but this simple replace is bothering all of us :S
 
10:09 AM
few years ago i thought text is some sort of jQuery namespace
@Neil maybe you would be able to tell me reason why this
<script src="..." async onload="this.remove()"></script>
won't remove script
Only thing I can think of, it's still executing?
which isn't too assuring
 
@Raimonds hmm, I'm guessing you can't simply remove the script on the page?
 
I tried to do that on codepen, works fine there
difference is in src that I am using for actual dev and sandbox example I tried
context of this is <script> tag
targeting it from F12 also removes it
 
.remove just removes the script tag from the DOM
it does not remove from the page source
 
yeah its still in DOM
 
you only removed its virtual representation. It is removed. You just don't see it, unless you try to find it
 
10:14 AM
that is my issue
 
you cannot do that
the page got served already.
 
It doesn't seem to be getting run
I don't know if scripts get an onload event
 
I am getting alert for sure
 
that's the script itself
I was trying to determine order of events, but onload isn't getting run at all
 
@Neil it does run. jsfiddle sandboxes the script tags. Setup a simple html file and do that onload test there
 
10:17 AM
ah
 
Hmm I was sure it has onload event
I mean I have asyc attribute on it and it's external source
maybe that is the reason I can see onload
 
but still, you cannot remove that script info from the page source
if you want to see it removed, don't deliver it
 
I don't need to remove it from source
I mean not from source that came as response
I need it out of code when we perform $("body").clone()
and re-inject clone back into body, causing all scripts run again
If you look at that async jsfiddle example and replace alert with this.remove() call you won't see script tag in inspect element anymore
But when I try to apply this to actual code it just does not remove it, so I am thinking what could be the reason
 
@BenFortune There is a vamps list?
 
Yes, and she is
 
10:27 AM
Is it publically available somewhere or in the RO repo?
 
Are you talking about those people who come to ask questions?
 
@neil @Raimonds @karelG a little coaching goes a long way ;) ty codepen.io/rusticblonde/pen/MMMOvO
just need to determine which character A with circumflex is best represented by (ie, hex etc ha!)
 
@geisterfurz007 bem suggest worck to update the table query, but the pagination get frozen and dont work, so how i make that worck? reload table?
 
@Raimonds did you not have thought to remove the script tags from the cloned dom?
 
@KirstyMarks well done :)
 
10:32 AM
ty @neil i know that is very basic lol
 
@KarelG this is my current implementation, but it feels ugly
 
and no doubt it could probably be written tighter ha.... baby steps and all ;)
 
why are you cloning the body btw?
element clones okay, but the whole body content?
 
I am on annual leave starting tomorrow, so I don't have time to fix root cause of that issue, which is print function itself.
placement student copy pasted juniors code from somewhere
 
no colleagues that can work further on it?
 
10:34 AM
I wanna close as much as I can today
 
solving bugs with hacks is demanding for problems or "wtf's" in the future
 
I jsut stumbled across fact I cant remove node on onload event
 
@KirstyMarks for what it does, it's written fairly succinctly I would say
 
you can. again.
query again that element after it
you should get null
 
Ok another day
 
10:35 AM
(or with jquery, an empty jquery object)
 
another painful few hours with chrome start
 
@neil tbh this is just a quick fix we are doing... Its nothing major :) I mean christ i just written a whole validation script on our site... i wouldnt had been doing that 4 years ago lol :P
 
it gives me back <script> tag ;D
 
but I have to go
 
that mf is still there, and I can't explain why
 
10:35 AM
!!afk lunch + out of office meeting
 
@KirstyMarks though ideally you'd just change the html rather than write a script to do it
 
:D
 
OMG I Have a good idea
 
but I'm guessing you have a good reason for that
 
right as a I opened this chat 😃 perfect!
 
10:36 AM
it's not really a bug, I just want to understand why it is not being removed
 
yea, @neil this is a json object tbh which needs to be updated. We just got a rollout happening atm so can't really touch it until its finished
 
I am using workaround to just remove it from results of .clone()
 
@KirstyMarks as a general rule of thumb, you should be as specific as possible with your select query
 
ok, point noted :)
 
nod
 
10:38 AM
how i reload table pagination by js?
 
I think quick fixes created my spaghetti code ;d
@NoobDEV-GBL you recalculate it and draw again
 
OMG hi @KirstyMarks are you KirstyHarris?
 
tbh, even the code i have working is not picking up that A with circumflex atm lol,.... at least i got it half working which is a good thing lol :P
yea lol ... oh dear am i that notorious
 
@NoobDEV-GBL you can do pagination in two ways, ajax or just normal page navigation
 
vOv
I moved to the UK realized you were one of the SO chat folks from UK
 
10:42 AM
the second is the easier, but your backend needs to load the data by page first
 
back to the depths of hell -- aka google chrome
 
Oh I remember you :)
 
hahah :)
i think its been about 3 years or so.... lol
 
welcome back
 
@Raimonds how can i do that? my code is this: paste.ofcode.org/aiygTw3TU4GpCVr3myfQnv
 
10:43 AM
ty :)... hopefully i wont be asking as many stupid questions. I'm doing UX dev now so constantly immersed in JS. I've only been at it 2 months but i love vanilla ha :)
 
js is a fun language if you're familiar with functional programming techniques
 
do you know how A with circumflex could possibly be returned via JSON @neil. I've tried all the codes i can think of, the code is working but not finding that lol :)
 
@KirstyMarks I don;t thing there is such a thing as stupid question, there is lack of knowledge
 
see im not. I've spent too many years just doing WP and Magento, so now i actually feel i can become a dev :P
 
I mean we can't know everything, that is the reason expertise sharing is a good thing
Sometimes I need a small push to accelerate to speed of light, and reading docs is not the best push available
 
10:47 AM
tbh, i've been quite fortunate and i know it doesnt seem it but i am writing so much more JS these days, its just sometimes im looking at it and im like what am i doing wrong :S
 
@KirstyMarks json is encoded using utf-8
So you need to find the corresponding code in utf-8 and write it like that
 
oh ok, cool so i need to find the UTF-8 code for A with circumflex. Cool, thankyou
 
try typing it in here to get the "encoded" version of the string
 
yikes...
\xC3\x82
 
10:57 AM
@KirstyMarks it should show it properly
 
Are there any caveats of adding a custom header to a request
from an extension?
Something like x-extension-request-uuid: uuid.v4()
 
11:34 AM
ANSWER ME!!! NOOOOOOOOW! 😛
 
@neil he managed to update it in the php field and str replaced it in php and it fixed it hahaha... saved me a job :P
 
11:54 AM
@ShrekOverflow Depends
In some cases, if you send something that might identify the user absolutely, you may be breaking the law.
IANAL, mind you.
 
12:06 PM
o.o
 
Hello
how is everyone
?
 
12:28 PM
She's technically KoS
 
@MadaraUchiha its just a uuid v4
unique to each request
 
@ShrekOverflow To what end?
 
@MadaraUchiha well here is the problem
chrome's extensions apis are a bit fragmented, webRequest doesn't expose the responseBody and chrome.debugger.network.onRequestFinished will only fire on request finished and misses out other things I need
so I need to co-relate them, one possible way to do that is basically

1. from webRequest add a custom header
2. from the debugger api read this header
 
Just like in the good ol' days of putting stuff on DOM elements to read from them elsewhere.
 
Yep
Unfortunately there is no other way to co-relate them except for temporal co-relation
but since multiple tabs can fire these requests
or just multiple requests can be fired
it beats the point, wdyt? @MadaraUchiha
should that extra header be fine? I don't think its identifiable as all requests will just be a uuid.v4()
which is sufficiently random
 
12:37 PM
Should be fine.
 
Thank you mate :)
I'll share the extension here once I am done and can Open Source it 😃
(it's in typescript, react so should be pretty judgable)
 
1:29 PM
guys I need your help :( I am on windows
w i n d o w s :'(
my package.json has this scripts:
"compile": "tsc -p . ",
"html": "copy -r ./src/assets/ ./dist/assets/",
"vue": "npm install --prefix ./vue && npm run build --prefix ./vue",
"start": "npm run compile && npm run html && npm run vue && node ./dist/server.js"
> copy -r ./src/assets/ ./dist/assets/

Das System kann die angegebene Datei nicht finden.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! penhistory@1.0.0 html: `copy -r ./src/assets/ ./dist/assets/`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the penhistory@1.0.0 html script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
 
install Win32GNUTools
or GNUWin32Tools
or whatever it comes with git for windows anyway
I just let it override the windows crapware
if yu haven't done that
you can just use the git bash shell
that git installs / creates
I need to take a programming 101 sometime lol
 
@ShrekOverflow being in front of behind the helpdesk?
 
@KarelG ?
 
101 is an old emergency number
 
no -- I never actually got formal education (even though I have a degree)
oh ok :P
 
1:43 PM
fyi copy is a cmd command
not bash. Don't think that it would work in git-bash :P
yup
KarelG@KG-WORK-LAPTOP MINGW64 /
$ copy
bash: copy: command not found
 
alias cp=copy ?
seems like the person has copy=cp on nix by the format
ooooor
they might be using copy from npm
and forgot it in devDeps
@KarelG and you can see how long I haven't coded
this new porject is exciting my mktg and sales skills are helping sell / stake holder manage really well
although my rusty dev skills are making it a jack shit, although they are coming back :)
 
fyi, GDPR agents are more technical profiles than being "lawyers".
 
I am not a Lawyer/ GDPR agent
 
I am just saying that developers can end in sales leading to code less, but there are also movements in other direction
 
Oh yes, the sales/mktg skills have helped a lot with project management and scoping in general
I sync'd early and fast. As opposed to flying with my dev idea.
 
1:55 PM
GDPR can suck it
 
@BenFortune it's actually very nice to have
just awful implementation but that's with any law 😛 give it time
 
@ShrekOverflow suck it
 
@BenFortune what's bad about GDPR?
or do you secretly work for Google?
 
The awful forced implementation of it, for almost no benefits
 
No benefits? Really mate?
 
00:00 - 14:0014:00 - 22:00

« first day (3195 days earlier)      last day (1757 days later) »