« first day (3566 days earlier)      last day (1607 days later) » 

00:23
Heyy guys I've been breaking my head since this morning
@Ishwar 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.
In Angular, I have a REST API configured which returns some data. Using a subscribe event with HttpClient returns me the GET data but it only refreshes upon update.
 
4 hours later…
user13904319
04:31
HI I am having an array like this
props: [{id: "307", name: "ABC11111"}]
when I access props[id] I am not getting anything can anyone say how to access this please
05:34
@ola obj.props[0].id is probably what you want.
06:13
Hello Community!
@kishore 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.
06:40
gud morning all
@User 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.
@JamesBot
i need to parse xml in ionic
ngx-xml2json
but unable to perform the parsing operation
any idea
is it secure to use static header key value pair as authentication
@RE60K
we currently have got the format in xml
can we parse it like we do the json parsing
as xml forum is very limited
07:17
@JupiterAmy 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.
1 message moved to Trash can
Hey folks, I am testing function in jest which uses the Date.
while running the test locally, it returns me the time in format 07:00 AM which is expected. And it works in my code also but the same test returns 7:00 AM when these tests are run on jenkins CI pipeline which results in failing tests on CI.
Any idea what could be causing that? The snippet is here
@JupiterAmy 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.
const time = new Date(startDate).toLocaleString('en-US', {
        timeZone: 'America/Los_Angeles,
        hour: '2-digit',
        minute: '2-digit'
      });
 
1 hour later…
08:22
Hi, I'm trying to have a simple way to build html in JS without megalibraries, here's approximatly what I'm looking for: frama.link/VuTMrXUX
@damio 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.
1 message moved to Trash can
08:44
Hey, I'm searching for a NPM package, like Gridster, that allows me to take a dragable element and drag it into other dragable element, so they would form parent-child relationship. I want to support this drag and drop functionality for n amount of levels. Do you know any candidates?
@Reed 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.
 
2 hours later…
10:55
I know it may be abhorred but here's a safe way to call a function with a specified context without using Function.prototype.call()
with (my_document) querySelectorAll('*');
compared to:
querySelectorAll.call(my_document, '*')
This is assuming that my_document does not own the querySelectorAll function, otherwise my_document.querySelectorAll would somewhat suffice
Another albeit weird (and perhaps unclean) way of making scope-adherent variables with the with statement is this:
with ({variable: null}) console.log(variable)
compared to:
let variable = null; console.log(variable)
Though, to be honest. I'm perfectly fine with var variables since I'm strict on how & where I use variables so I don't have much use for const or let
11:14
hi guys, anyone know whats the `key` is in `useHistory().location.key` from react-router
coudn't found anything from docs https://reactrouter.com/web/api/history
What is best practise to solve the browser caching problem in the case of javascript\css ? Add a query string to the url or load with jQuery.getScript...?
Query strings are more backwards-compatible...
Aw, StackOverflow removed reactions..
11:32
...o.k. thx..To force the loading it needs only the query string at the end of the url ? So when i want to reload maybe an external javascript...i have only to change the query string in the url at the src attribute...nothing more ?
12:28
@FerencRozsa
I think so. To prevent modern browsers from caching a file in particular, all you need to do is append a random (emphasis on random) query string value at the end of the URL e.g.: `do-not-cache-this.jpeg?instance=123426539075322`
Not that this works with most (if not all) file types, not just JavaScript source files as with jQuery.getScript()
anyone has any idea about how to handle query change from browsing, in react-router ??
navigating prev/next page doesn't cause reload
@aXuser264 Sorry, I don't know
do u any have refer/docs something that like that
got nothing from intersting google,stackover
13:09
hello brothers , any one knows plotly lib for javascript ?
@Coder 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.
:49986878 props[0].id
13:51
Hi All
im trying to put a placeholder in a string variable and then i have to replace it with dynamic value
let confirmationText = 'this is confirmation about account validity for {0}'

myBusinessVariable = confirmationText.format("International Account")
but the above code does not work and i get the error format is not a function
Hey folks, I am testing function in jest which uses the Date.
while running the test locally, it returns me the time in format 07:00 AM which is expected. And it works in my code also but the same test returns 7:00 AM when these tests are run on jenkins CI pipeline which results in failing tests on CI.
Any idea what could be causing that? The snippet is here
const time = new Date(startDate).toLocaleString('en-US', {
        timeZone: 'America/Los_Angeles,
        hour: '2-digit',
        minute: '2-digit'
      });
14:45
@Lapys That's more of a fix for non-modern browsers. Modern ones hopefully respect the Cache-control header. IE, as always, didn't because it was just put on God's green Earth to punish us for our sins. I remember IE8 needed Pragma: no-cache and Cache-control: no-cache and those had to be in a particular order, otherwise it ignored them.
MORNING YALL!
15:35
posted on July 21, 2020 by Nicholas C. Zakas

GitHub Actions1 are programs designed to run inside of workflows2, triggered by specific events inside a GitHub repository. To date, people use GitHub Actions to do things like run continuous integration (CI) tests, publish releases, respond to issues, and more. Because the workflows are executed inside a fresh virtual machine that is deleted after the...

16:10
posted on July 21, 2020 by Marina Kazatcker

The Stable channel is being updated to 84.0.4147.94 (Platform version: 13099.72.0) for most Chrome OS devices. This build contains a number of bug fixes and security updates. Systems will be receiving updates over the next several days. You can review new features here. If you find new issues, please let us know by visiting our forum or filing a bug. Interested in switching channels? Find ou

 
1 hour later…
17:28
posted on July 21, 2020 by Daniel Gagnon

The Dev channel has been updated to 85.0.4183.34 (Platform version: 13310.24.0) for most Chrome OS devices. This build contains a number of bug fixes, security updates and feature enhancements. Changes can be viewed here. If you find new issues, please let us know by visiting our forum or filing a bug. Interested in switching channels? Find out how. You can submit fee

17:53
Confession: For a long while now, while trying to build a JavaScript library that was backwards-compatible with all browsers I've gotten stuck in this coding methodology for only JavaScript and it's affected the way I personally code.
I can't write JavaScript code without first shimming the crap the out of it, or halting the currently running script with an error demanding for some required modern features.
For example: I got scarred when I realized this doesn't work in IE5
`"Hello, World!"[0] // undefined`
So now, I always call it as "Hello, World!".charAt(0) // 'H'
But that's a more innocent example.
In production code, I write whatever is necessary and follow the norm that's been set by my fellow peers but personally I cannot write JavaScript code without making sure it works on every non-text-based commercial browser first
(I think I need help...)
18:57
 <ThemeContext.Consumer>
      {({theme, toggleTheme}) => (
        <button
          onClick={toggleTheme}
          style={{backgroundColor: theme.background}}>
          Toggle Theme
        </button>
      )}
    </ThemeContext.Consumer>
Can someone explain, why "theme, toggleTheme" is wrapped in curly braces? And why is the whole function then again wrapped in curly braces?
I guess the function is wrapped in curly braces to pass it as an object to ThemeContext?
yes, the func is wrapped to be passed as a JavaScript expression to be used as the children prop of the ThemeContext.Consumer JSX tag's component instance
({a, b}) means that the a and b are not parameters passed to the function but are properties inside the first parameter passed to that function, which is an object
{a, b} deconstructs the first parameter passed to the function into two variables that have the same value as the properties inside that object
Thanks very much
you are welcome
 
1 hour later…
20:30
JavaScript on the Browser: String(setTimeout) // -> "function setTimeout() { [native code] }"
JavaScript in the Node.js environment: String(setTimeout) // -> "function(...) { /* code anyone can clearly see */ }"
Why is the Node.js code not obfuscated?
@Strict "use strict";
https://www.instagram.com/p/CC5weBODk1w/
I will select the textarea element in the above post with javascript, write a comment on it and send it.


For testing purposes, I made a sample comment using the following code with the browser console and added it to the textarea. However, textarea is not added as a value in the textarea even though the comment appears on the screen and it is deleted when the textarea is focused.


Code:
document.querySelector("textarea.Ypffh").value="Hey!"



As a result of the examination, when the focus is made to the textarea element, the "focus-visible" class 

« first day (3566 days earlier)      last day (1607 days later) »