« first day (3686 days earlier)      last day (1268 days later) » 

1:18 AM
Please help me out with my question... I've been trying to solve this basic vanilla JS issue I am having for days: stackoverflow.com/q/64885334/13808207
 
@XaviFont 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.
 
Hello?
Please review the link
 
2:11 AM
posted on November 18, 2020 by Ben Mason

Hi everyone! We've just released Chrome Beta 87 (87.0.4280.66) 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

posted on November 18, 2020 by Ben Mason

Hi, everyone! We've just released Chrome 87 (87.0.4280.66) for Android: it'll become available on Google Play over the next few weeks. This release includes stability and performance improvements. You can see a full list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Ben Mason Google Chrome

 
 
1 hour later…
3:23 AM
Drake really is the best music to code to. Scary but i've proven and quantified this now. ffs
 
@devsandbox 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…
5:01 AM
Hello world. Suppose there is a module foo. But, it is absent in the project's package.json file, but, present in the project's node_modules folder. How is nodejs going to behave here?
 
 
3 hours later…
7:52 AM
@YaxirBajwa 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
 
Hi I have a code which is getting data from firebase ,data is kepts against the uique key i used map method for this in this way all data is getting but i want to get the separate data e.g i f i have data ={ id1:{name:'',email:'',cnic:''}} if i only want cnic then what will be the code i have pasted my code below
 <div>
        {seller_data &&  Object.keys(seller_data).map((data, index) => (
        <div key={index}>
          <div>Firebase Data</div>
          {seller_data[data] &&
            Object.keys(seller_data[data]).map((val,i) => (
Hi I have a code which is getting data from firebase ,data is kepts against the uique key i used map method for this in this way all data is getting but i want to get the separate data e.g
data ={ id1:{name:'',email:'',cnic:''}} //structure is as                                                                  <div>
        {seller_data &&  Object.keys(seller_data).map((data, index) => (
        <div key={index}>
          <div>Firebase Data</div>
          {seller_data[data] &&
            Object.keys(seller_data[data]).map((val,i) => (
              <div key={i}>
                {seller_data[data][val]}
                </div>
            ))}
        </div>
i want to extract only cnic from the above data how can i do this?
 
8:21 AM
anyone use meteor?
@ya
@YaxirBajwa your doing too much in the template
seperate your concerns
impossible to read
 
8:42 AM
ok i will try to simplyfy this the code present in div is mapping the data coming from firebase and structure of the data is same as data :{ { id1:{name:'',email:'',cninc:''},{ id2:{name:'',email:'',cninc:''},} and if i run above map code i am getting all the data include name,email and cninc of all objects but i want to extract specific data from e.g only cnic how can i get that hope it will understandable
 
ABC
in gridster2 is it possible to zoomout the item?
 
9:07 AM
hey guys
 
 
4 hours later…
1:01 PM
@deostroll pretty sure it will find it
 
 
3 hours later…
3:36 PM
HEllo
var fin = document.getElementById('fin')
var counter = 0
var rand = Math.floor(Math.random() * 1);
var NTW = ['One','Two','Three','Four','Five']
var Which = NTW[rand]

var temps = {
One: {
text: 'placeholder',
needs: 5,
requests: ['adjective','noun', 'verb', 'plural noun','plural noun', 'All done! hit submit one more time to see your finished mad libs.']
}
Two: {
text: 'placeholder',
needs: 5,
requests: ['adjective','adjective','liquid','adjective','adjective','noun','adjective','All done! hit submit one more time to see your finished mad libs.']
 
4:00 PM
Any idea why that code only works when I remove the object two from the code?
Also can I get some help with this? stackoverflow.com/questions/64866776/…
 
@LlamaButt Try add touch-action: none style to your canvas and add event.preventDefault() in pointerup/down/move events (see developer.mozilla.org/en-US/docs/Web/API/Pointer_events/… and referencing stuff).
might be the browser handling the touches (for gesture recognition like zoom/pinch/scroll) instead of the canvas
 
Where do I add event.preventDefault?
 
just add it at the beginning of the event handler
 
i have uploaded a file to server , how can I save the uploaded file on the browser storage also ?
 
4:15 PM
idk
 
canvas.addEventListener("pointerdown", (event) => {
   event.preventDefault();
   drawing = true;
})
f.e.
 
Thx! how does that work?
YOU MUST TEACH ME THE WAYS OF THE JEDI
lol
 
it stops the event bubbling
also used in submit buttons onClick and so on
ah.. thats actually wrong, it "cancels the default action"
 
4:49 PM
Any ideas on how I could detect a change in a CSS value of an HTML object using DOM without using jquery?
ehh nvm
Is there a way to save what's been drawn on a canvas to local storage?
 
5:12 PM
@LlamaButt sure
|| mdn canvas.getImageData()
james where did you go!
 
@LlamaButt ^
 
Thanks!
 
5:31 PM
Is there any way that I could make something like this work? I know that I can't actually use numbers for variable names but this is just pseudocode and I have a numbers to words function in my code but anyways, variable A = 5, variable 5 = hello, alert variable A and get hello
 
5:42 PM
@AdiG15 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.
 
BRB ima go mutilate the code for this fucking bot
 
148
A: "Variable" variables in Javascript?

Felix KlingThere is no single solution for this (well, there is eval, but lets not seriously consider that). It is possible to access some global variables dynamically via window, but that doesn't work for variables local to a function. Global variables that do not become a property of window are variables ...

So basically, there is no syntactical construct for that (like f.e. in PHP) but you can do a lot of stuff that behaves like it, some more horrifying than others.
 
messages = { 5: "hello" };
let a = 5;
alert( messages[a] );

If this is what you were asking ?
Here the a is 5, which then maps to the message which should be alerted
 
Thanks, I'll try that.
 
 
2 hours later…
7:28 PM
What is browser polyfill and how can we use the browser polyfills in cross browser extension

Hi

I had implemented a chrome extension and in chrome extension, I'm using the chrome's callback APIs. Now I want to make the chrome extension work in edge and firefox. Also, I did sample firefox extension, and I learned that the firefox extension is using browser-polyfill promise APIs. also, the firefox supports chrome's callback API. But I learned that browser polyfill promise API is far better than chrome. So I'm trying to learn about the browser-polyfill in cross-browser extension. but I don't
 
@vaiuser 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.
 
7:54 PM
@vaiuser what?
|| mdn polyfill
 
@vaiuser read that
 
8:14 PM
@vaiuser 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
@vaiuser 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
 
@JBis I'm trying to write an extension using polyfills and I found a sample extension which has browser-polyfill.js file, and I'm trying to figure out how it can code


    the code is like



    (function (global, factory) {
      if (typeof define === "function" && define.amd) {
        define("webextension-polyfill", ["module"], factory);
      } else if (typeof exports !== "undefined") {
        factory(module);
      } else {
        var mod = {
          exports: {}
        };
        factory(mod);
 
did you read what i sent?
@vaiuser that's webpacked or something
 
im follwing that thankyou for the documentation
@JBis so we'll have to use webpack and babel for an extension, that's the meaning right
but the sample dosent have any json file or config files other than manifest
https://github.com/rpl/example-msedge-extension-with-webextension-polyfill
 
user13995420
8:37 PM
hi
 
@YosefefriemRosner 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.
 
user13995420
anyone use post requst in express ?
 
user13995420
im trying to figure out how to respond to one without deleting the entire page ? help please link or whatever is fine
 
yep
though i suspect your question is entirely unrelated to express
 
lol kevin
 
9:04 PM
hey
 
o/
 
I'm passing a validator service to a reactive forms control in Angular
But not sure how to actually unit test the validatorService functions, because they don't accept a form group as a parameter
any ideas how I could test? It looks like its a factory function
so something like this
 value: [
            { minimum: selectedThresholdItem?.minimum || 0, maximum: selectedThresholdItem?.maximum || 0 },
            Validators.compose([this.validatorService.nonZeroValidator('maximum')]),
          ],
Or maybe this is better as an SO question
 
9:22 PM
i am having an array of objects, i want to edit one object's property value in that array. is there a good way in es6+ to do that?
 
foo[4].bar = 'baz'
 
ok, so basically, search for the item first, get its index and just change the prop value in a normal way.. i was looking for a newer way to do this within the array.. but that works still
 
if your array was instead a map, using indexes that you'd typically use to "search" by, you would be able to access the intended object directly
rather than searching
but otherwise, yea you'd have to find the index first
 
9:38 PM
posted on November 18, 2020 by Bindu Suvarna

Hi, everyone! We've just released Chrome 87 (87.0.4280.60) for iOS: it'll become available on App Store in next few hours. This release includes stability and performance improvements. You can see a full 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

 
10:08 PM
posted on November 18, 2020 by Bindu Suvarna

 Hi, everyone! We've released Chrome Beta 88 (88.0.4324.9) 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 (3686 days earlier)      last day (1268 days later) »