« first day (4030 days earlier)      last day (920 days later) » 

1:38 AM
 
 
3 hours later…
user17161735
4:11 AM
hello guys
 
user17161735
anyone can help me with this:
```javascript
async function fetchfiles() {
    return {
        html:await fetch(chrome.runtime.getURL('src/html/frame.html')).then(r=>r.text()).then(r=>r),
        css:await fetch(chrome.runtime.getURL('src/css/frame.css')).then(r=>r.text()).then(r=>r),
        js:await fetch(chrome.runtime.getURL('src/js/frame.js')).then(r=>r.text()).then(r=>r),
    };
}

const components = fetchfiles()

console.log(components.css); // undefined output```
 
4:26 AM
Hey guys, first time in the chat. Was going to ask a very simple noob JavaScript question
 
@Oxin 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.
 
Can i ask it here?
instead of posting it
It's regarding the if else conditional statement
 
yup go on
 
@Usama 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.
 
 
1 hour later…
5:40 AM
@Arcanis-TheOmnipotent const components = fetchfiles() -> const components = await fetchfiles() You need to await async functions to get the output. They always return promises.
In addition, then(r=>r) is useless. See Is ".then(function(a){ return a; })" a no-op for promises?
 
 
3 hours later…
9:05 AM
I saw in MDN await is mentioned as an operator but in unary operators list it is not mentioned. Can I call await is an unary operator?
 
@DamodaraSahu await is a keyword
@Oxin don't ask to ask just ask
Here is the list of operators @DamodaraSahu 262.ecma-international.org/12.0/#sec-unary-operators - can you find await there? :)
 
9:24 AM
But MDN precedence table, it is mentioned await is an operator with precedence level 17 and assoviativity right to left.
 
10:01 AM
hey weird question, but any englishmen can help translate a term? What's the word for a (sport) training focussing on stamina.. As opposed to technical, strategic or power based training.
Naively I said "condition training" but apparently that's not the correct term
 
10:17 AM
You mean the english word for uithoudingsvermogen, @paul23?
 
"conditie training" :P
 
Same same, I'd say "Endurance training"
Or maybe fitness
 
10:36 AM
Endurance seems right - An Englishman
fitness is a more generic term
 
So, very basic question about yarn workspaces if anyone knows, it's not clear to me where you end up doing the yarn add, in the root or in the correspondent subrepo?
 
11:27 AM
I want to import a simple .html file as a plain string in a java script module but when I do I get the error:
"Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec."
Yet another javascript that does this has no problems doing so, the line of code is identical
 
@JBis A plausible approach in most cases. Thanks
 
11:46 AM
@DamodaraSahu read the link I sent - (hint, await is in the list)
@Trufa subrepo unless it's a dependency that's used across all the workspace
Also it's not a subrepo it's a project in the workspace ^^
 
ah
makes sense, thanks @BenjaminGruenbaum
 
Sure, it's not very well documented
 
@BenjaminGruenbaum
 
No it isn't, I guess it's kind of obvious, but first time setting it up
when I actually did it it worked out as I expected tho, but I think it's assumed knowledge
 
11:57 AM
It's just poorly documented
Generally, npm is better documented and they copied this feature from yarn anyway
 
12:25 PM
Am I missing a way to just say "give me the content of this file as a plain string" in Javascript (e.g. in this case I want to set the content of a popup-window to the HTML inside a .html file)
let htmlstring = someway("./stuff.html");
let popup = window.open("about:blank");
popup.document.write(htmlstring);
 
1:02 PM
As in fetch('./stuff.html').then(x => x.text())?
It's async, I am assuming you know async/await and promises @salbeira but if you don't I'm happy to refer you to a tutorial/question.
 
Yes I was hoping for something synchronous or rather something that happens on first module load
I saw some import varname from "./stuff.html" in a file and thought it might work
But it doesnt in browsers
that seems to be a server side cheat
for node
 
1:40 PM
Should data validation be done in middleware? Every Node project I see have their own ways of dealing with data
 
Also, if you are using a bundler you can inline it
If you have top-level-await (your'e writing a module) it's just a matter of adding async before it.
 
top level await?
 
The ability to write await outside an async function
@Taseer data validation is a huge topic and it really depends on what data you're validating
I know that's not super helpful but it really depends on what framework you're using - most frameworks have it "built in"
 
2:05 PM
@BenjaminGruenbaum I am using Express. To put it simply, I am trying to validate all fields for a user registration
I have 9 fields to verify
I was thinking of using Joi to validate each field in a middleware and if it's all good, then call the signup route where it would only focus on saving the user in a DB
Is this an optimal approach?
 
Yo guys
 
@MeryemACHEMLAL 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 code but i don't know why it does nor working, even it's a simple code of
if condition
   $(".btn-superimposed").parent().addClass("btn-superimposed-wrapper");


   $(".btn-superimposed-wrapper").each(function () {
      if (($(this).prev(".wp-block-group")) && ($(this).next(".wp-block-group"))) {
         $(this).css({ "margin-top": "-8rem", "margin-bottom": "-6rem", "text-align": "center" });
      }
   });
 
@MeryemACHEMLAL Please don't post unformatted code - use the up arrow to edit your post, then hit Ctrl + K to format the code in that post. 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.
 
i need to add the css style to button when its have a div.wp-block-group before AND next
but if for example i chane the name of the div wp-block-group, it style apply the css
knowing that we have a condition with AND
but if for example i CHANGE the name of the div wp-block-group, it style apply the css
knowing that we have a condition with AND
 
2:22 PM
.prev and .next both always return a jquery colleciton, which is an object, and therefore always "true" in your if condition.
Did you intend to apply a class to the first and last divs with a given class?
 
hey Kevin, Don't pay attention to the forst line ^^'
just this :
 $(".btn-superimposed-wrapper").each(function () {
      if (($(this).prev(".wp-block-group")) && ($(this).next(".wp-block-group"))) {
         $(this).css({ "margin-top": "-8rem", "margin-bottom": "-6rem", "text-align": "center" });
      }
   });
first line*
>Did you intend to apply a class to the first and last divs with a given class?

actually i attend to add some css to .btn-superimposed-wrapper if there is a div with .wp-block-group class before AND after
 
 
3 hours later…
5:06 PM
posted on October 28, 2021 by Krishna Govind

Hi everyone! We've just released Chrome Beta 96 (96.0.4664.27) 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. Krishna Govind Google Chrome

 
5:33 PM
Reserved words cannot be used as identifier. arguments and eval also can't be used as identifier in strict mode, but they are not listed under reserved words. Why?
 
@DamodaraSahu Because they are not reserved words. You're conflating concepts here. Not everything that is unusable as identifier is "reserved".
Also, I'm not entirely sure how practical this is. These are not usable as identifiers because it makes very little sense to use them. It's just a way to avoid some potential problems if somebody redefines eval or similar. I don't think I've ever seen any real-world code that would benefit at all from knowing the exact reason here.
 
6:25 PM
Hii I have a doubt..we have asp.net webforms tool thats deployed. I see when i select the dropdown value it stops i have observed that there is a debugger on that particular line. can some one pls tell whether is it fine to have debugger in js file in the production published folder?
I have observed that in the chrome browser..When i select the select the drop its triggering to the debugger that is written in that particular js file.
 
6:37 PM
@VenkataShivaram The debugger statement will trigger only if the dev tools are open. With that said, I'd definitely not recommend having them in production code. It's plain sloppy for a start.
 
 
2 hours later…
8:28 PM
@VLAZ Sure! I see when the user select some particular dropdown its not working..as it is restricted only for admins..Thanks for sharing your thought on this!
 
9:06 PM
posted on October 28, 2021 by Prudhvikumar Bommana

The Extended Stable channel has been updated to 94.0.4606.113 for Windows and Mac which will roll out over the coming days/weeks. A full list of changes in this build is available in the log. Interested in switching release channels? Find out how here. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn abou

posted on October 28, 2021 by Prudhvikumar Bommana

The Stable channel has been updated to 95.0.4638.69 for Windows, Mac and Linux which will roll out over the coming days/weeks. A full list of changes in this build is available in the log. Interested in switching release channels? Find out how here. If you find a new issue, please let us know by filing a bug. The community help forum is also a great place to reach out for help or learn about c

 
I Was getting this console error while i was trying to run my angular project with ng serve .
VM48:7288 crbug/1173575, non-JS module files deprecated.
I was getting from last 3 days at least daily once. I have make sure that i have no errors in my application..
expect(!loadTimeData, 'should only include this file once');
loadTimeData = new LoadTimeData;

// Expose |loadTimeData| directly on |window|, since within a JS module the
// scope is local and not all files have been updated to import the exported
// |loadTimeData| explicitly.
window.loadTimeData = loadTimeData;

console.warn('crbug/1173575, non-JS module files deprecated.');
in the developer tools the error it was taking to the above line.
My current chrome version: Checking for updates
Version 95.0.4638.54 (Official Build) (64-bit)
 
 
2 hours later…
11:41 PM
I am learning Angular. There is a class with a property status: boolean= false; and a button element defined in .html has (click)="<placeholder>". How to replace <placeholder> with an arrow function or lambda to set status=true;?
 

« first day (4030 days earlier)      last day (920 days later) »