« first day (3665 days earlier)      last day (1266 days later) » 

12:28 AM
@rasfuranku have you thought of separating them with a special character?
like a special unicode character other then that do whatever you like
 
 
2 hours later…
2:01 AM
Hey guys, do you help first-timers at programming?
 
@beginner_coder1 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.
 
Cause I have no idea how to start at this problem and need serious help 😭
 
 
1 hour later…
ABC
3:25 AM
how to fix the "Can't be placed in the bounds of the dashboard, trying to auto position!/n{"cols":1,"rows":1,"x":0,"y":0}"
 
 
5 hours later…
8:32 AM
I'm using nodemailer with a deticated gmail account in firebase functions to process a contact form. Every month I'm getting a mail from Google saying Less secure app blocked.
 
 
2 hours later…
10:36 AM
In a JSX file I export a const that returns React components. What is the docblock return for this? I tried React.Elements and a few others but I can't get the right one
(code wont run as it has React tags but just to show some code)
 
 
2 hours later…
12:46 PM
    for(let i = 0; i < 10; i++) {
     const n = (Math.random() * Number.MAX_SAFE_INTEGER);
     console.log(n, ~~n, Math.floor(n));
   }
 
@dievardump 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.
 
It was formated, it's just Stackoverflow who still doesn't understand that you should be able to have formated code and text in on message!!
Today I learned that ~~ isn't a good alias to Math.floor
 
1:19 PM
Heya, how are you ?
 
@MiloMoisson 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.
 
Thanks smol bot...
 
hello all
canyone help me in javascript
 
@User 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
 
for (let i =0;i<this.productsListInformation.length;i++){
        console.log(this.productsListInformation[i].name);
         this.strProductNameCart = this.productsListInformation[i].name;


         if (this.productsListInformation && this.productsListInformation.length) {
          // not empty
          alert('not empty')
       } else {
          // empty
          alert('empty')
       }


        // console.log('Tushar ' + this.strProductNameCart);
       }
 
@BenFortune
 
2:06 PM
lol
hows it going y'all? o/
 
gud...
 
2:26 PM
hey guys is there a way to prevent values from overlapping each other? for example i have an input range for low and it from 2 to 6 and then the next input boxes are for high and they are from 7 to 10. what i want to prevent in the high values being less than 6
 
@BenFortune I knoooow, I was just always told that ~~ == Math.floor
 
@LuDevGon what
 
use min/max
 
if high value is always 7 to 10, will sure never go under 6, I think that's what JBis meant with his "what"
 
^
 
2:29 PM
the values are not set they can change them but if they do 6 or less it will break the code since low min and max is 2 and 6 already
 
but yeah, use <input name="high" min={Math.max(low.value+1, high.value)} />o or a similar system
 
im working with angular js
 
like with a datepicker :

everytime low changes, set high min to low+1
everytime high changes, set low max to high-1

this way it will never overlap
So, this chat becale so calm. What are the new trends in JS?
 
2:52 PM
mind blown
 
🚽
 
so i needed to include a closing script tag in my string "</script>" but if I that the HTML parser parses it as closing the script tag itself not as a string. My first instinct was to use HTML encoded values (&lt;) but then the string actually contained &lt; instead of <.
I searched it up and found a solution but its so stupid simple.
"</script" + ">"
 
lol
 
3:07 PM
this is pretty interesting, so apparently js executed in iframes will block the main page in Safari and Firefox but not in Chrome.
hmm
ok this is actually really helpful especially because almost everyone uses chrome
It allows us to thread tensoflow backend WebGL much before OffScreenCanvasAPI becomes available
 
user5591717
4:16 PM
hi have a question...
 
@Fee-fi-fo-fum 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.
 
@Fee-fi-fo-fum ?
 
4:41 PM
What's wrong with the UI
 
@LeapHawk 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.
 
5:09 PM
!!joke
 
What's the best part about TCP jokes?
I get to keep telling them until you get them.
 
This is a UDP joke, I don't care if you get it.
 
6:09 PM
I have a question about Javascript classes. Is the best way to pass data among methods, getters, and setters to set the data to an initial value within the constructor and then change that value based using your methods? I've tried to pass values as parameters but that never seems to work.
 
@rguttersohn 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.
 
@rguttersohn ever heard of the decorator pattern? It might fit for you
the idea is the constructor takes in data, and manipulates it in some way and spits out something else
and you can mix and combine however you wish
like say, if you wanted all our json messages to have an error code and timestamp, you could use a decorator to take in the message and append that information to it automatically
 
@Neil I haven't. Ive basically been using the constructor to hold global data that methods can change. That changed data can be used by other methods afterward. Can you send me any documentation on this?
 
good evening can anyone tell me how to keep session alive in angular 10 when a user change page and goes back to the previous one?
 
In object-oriented programming, the decorator pattern is a design pattern that allows behavior to be added to an individual object, dynamically, without affecting the behavior of other objects from the same class. The decorator pattern is often useful for adhering to the Single Responsibility Principle, as it allows functionality to be divided between classes with unique areas of concern. The decorator pattern is structurally nearly identical to the chain of responsibility pattern, the difference being that in a chain of responsibility, exactly one of the classes handles the request, while for...
also consider a facade pattern, so you can present only the data relevant to how it's being used
The facade pattern (also spelled façade) is a software-design pattern commonly used in object-oriented programming. Analogous to a facade in architecture, a facade is an object that serves as a front-facing interface masking more complex underlying or structural code. A facade can: improve the readability and usability of a software library by masking interaction with more complex components behind a single (and often simplified) API provide a context-specific interface to more generic functionality (complete with context-specific input validation) serve as a launching point for a broader refactor...
for the second, you'd have a big model object with all the info, and then the Facade would only expose the data being used
so the ones accessing that instance don't get the big model object, but the smaller and simplified version
 
6:19 PM
@Neil super appreciated. Let me do some reading up on this.
 
take a look at both, it may be useful to you (but also don't feel obliged to use them if you don't feel they fit)
 
+1 for decorator pattern
 
@Neil do you have any idea on how to keep the session alive on angular 10 when a user changes page and goes back to the previous one
 
@Riccardo hmm, that has to do with the backend doesn't it?
 
@Neil it does
 
6:22 PM
I can't say I'm too familiar with Angular, sorry. Do they also manage backend stuff in node js?
 
i suppose anyway can you link any question about this topic on SO?
 
@Riccardo you have a keyboard
 
i do
 
So you don't want the session to time out
 
yeah let's say a user may need to keep some filters on a page when he goes back to the previous one without having to reset such filters
did I make myself clear?
 
6:26 PM
you can save that information locally or you can save it backend
if it's just a couple pieces of information, consider just saving it locally
especially if it's not related to authentication
if you need to save authentication details or more than a couple pieces of information, then backend is probably better
 
@Neil, I think facade is what I am looking for. Thanks much!
 
@rguttersohn good :)
 
@Neil any question i can take a look?
 
for the backend solution? that sort of depends on what you're using for the backend. For local storage : developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage or developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
 
if that data is made part of the url, going back would change the url, all you'd need to do is read it.
assuming you're still just talking about filtering
 
6:40 PM
and yeah, if it's part of the getter URL, that information is already there
 
 
1 hour later…
8:03 PM
Unrelated but is anyone in here familiar with CSS Im having a fight with it right now
 
8:45 PM
|| welcome bigchungus
 
@bigchungus 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.
 
@bigchungus yep, welcome to the wonderful world of CSS
 
9:04 PM
0
Q: Call /pass query string URL with Ajax

Lubo MasuraI am using Essential addon for Elementor tabs in wordpress. I have implemented this script to call a tab with URL query string. Everything works fine and after page is refreshed with query string (f.e. /?bonjour it opens the called tab content) but I need to call a string and whole process with A...

 
Someone knows how to debug fetch function? I get nothing back, how should I know what is the reason?

https://stackoverflow.com/questions/64561318/fetching-resources-from-google-analytics-services-using-https-by-wix-fetch-funct
 
Which line exactly is giving you undefined?
.then( (json) => console.log(json.someKey) )?
What precisely was the error, if any?
 
GetJSON(url.code).then(httpResponse => {console.log(httpResponse, 'fetch json')})

The fetch function
httpResponse is undefined, so I assume something wrong with this function
 
err
i don't see GetJSON in your quesiton
 
9:22 PM
Because this function wraping the fetch function, this is not the reason
export function GetJSON (URLCode){

fetch( "https://accounts.google.com/o/oauth2/token", {
 
ah
well
you never returned the fetch
or a promise
or anything
 
@idan 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
 
This is run from my client

GetJSON(url.code).then(httpResponse => {console.log(httpResponse, 'fetch json')})


and this is run from my server

export function GetJSON (URLCode){

  fetch( "https://accounts.google.com/o/oauth2/token", {
  "method": "post",
  "headers": {
    "Content-Type": 'application/x-www-form-urlencoded'
  },
 'body' : JSON.stringify({
    'grant_type': 'authorization_code',
    'code': URLCode,
    'client_id': 'XXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com',
    'client_secret': 'XXXXXXXXXXXXXXXXXX',
@KevinB I used .then to return the fetch function, please take a look at the code above
 
i don't understand this line: return GetJSON
GetJSON isn't defined as something other than the function inside the function, why would the function return itself?
Other than that return, nothing is returned from GetJSON
ideally... the fetch should be returned
 
9:37 PM
@KevinB you right , but nothing change if I removed return GetJSON line
@KevinB The function return httpResponse.json(); so it OK
 
no it doesn't
that return is in a callback, it doesn't return from GetJSON
 
I added console.log and attached error
httpsResponse is called, what is wrong? how to fix it ?
 
9:55 PM
check the network tab for why the response isn't a success
 
 
1 hour later…
11:11 PM
posted on October 28, 2020 by Ben Mason

Hi everyone! We've just released Chrome Beta 87 (87.0.4280.38) for Android: it's now available on Google Play. You can see a partial list of the changes in the Git log. For details on new features, check out the Chromium blog, and for details on web platform updates, check here. If you find a new issue, please let us know by filing a bug. Ben Mason Google Chrome

 
11:35 PM
posted on October 28, 2020 by Bindu Suvarna

Hi, everyone! We've released Chrome Beta 87 (87.0.4280.39) for iOS: it'll become available on App Store in next few days. You can see a partial list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Bindu Suvarna Google Chrome

 

« first day (3665 days earlier)      last day (1266 days later) »