« first day (4115 days earlier)      last day (816 days later) » 

12:16 AM
posted on January 21, 2022 by Srinivas Sista

The Beta channel has been updated to 98.0.4758.66 for Mac ,Windows and Linux. 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 issues, 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 common issues. Srinivas SistaGoogle Chrome

 
 
4 hours later…
user17631451
4:05 AM
I have a question.
 
user17631451
I created a random background code here.

3 different ways.
 
user17631451
Code 1
jsfiddle.net/tjgzy45p

(function randomBackground() {
  const colors = ['1', '2', '3'];
  const random = colors[Math.floor(Math.random() * colors.length)];
  document.querySelector('body').classList.add('play' + random);
}());
 
user17631451
Code 2
jsfiddle.net/jvzodrsL/1

(function randomBackground() {
  const colors = ['play1', 'play2', 'play3'];
  var random = Math.floor(Math.random() * colors.length);
  document.querySelector('body').classList.add(colors[random]);
}());
 
user17631451
Code 3
jsfiddle.net/b5y74nvt

(function randomBackground() {
    const random = Math.floor(Math.random() * 3 + 1);
    document.querySelector('body').classList.add('play' + random);
}());
 
user17631451
How do I know which is the better of the 3 codes I made?
 
10:01 AM
I have a question. Which may very well be a stupid question. But I have nowhere else to ask it. So I'll ask it here anyway:

Is there a straightforward way to convert JavaScript into JSON?
 
10:24 AM
@Rounin JavaScript object or JavaScript code? For the first one : JSON.stringify() for the second - no.
|| mdn JSON.stringify
 
@VLAZ - Thanks. That was pretty much the answer I expected. JS Code, yes. (Not JS objects.)
 
@Rounin AST
acorn/esprima are good places to start
 
Yes - JSON is a simple data format which doesn't have functions or any code. Just strings, booleans, numbers, nulls, and collections of those (as objects or arrays).
You could serialise code as strings or as AST as Ben suggests. Then you have to re-create it on the other side. Which is doable, just not something I'd call straightforward.
 
10:39 AM
@BenFortune - that's fascinating. Thank you.
 
Due to many hairy edge cases. If you steer away from them, it's not really that much of a hassle but still - you need to know what to stay away from.
 
Thanks @VLAZ - it's related to a project I've been working on (on and off) for some time. I wrote bi-directional HTML <=> JSON and CSS <=> JSON conversion some time ago. I'm just now finishing bidirectional JS <=> JSON conversion. I'm not unhappy with my work but it occured to me I should check to see if other approaches already exist.
My intention is to have a JSON-based format which can describe components which can be parsed by any language which can read JSON - be that JavaScript, PHP, Python, Deno etc.
 
 
3 hours later…
1:48 PM
Its causing issue in Safari so
 
2:17 PM
o/
 
3:00 PM
hi guys
can I have a question
I have a input text and a icon calendar. When user clic on "icon calendar", it appears to client the calendar and he can choice the date. The input field is filled up about the date that the user has choided. WHat event is called, I need to capture it but i dont' know waht it is
 
Hi @Doflamingo19 - I think you're looking for onchange - see: developer.mozilla.org/en-US/docs/Web/API/HTMLElement/…
Depending on what you need, there is also oninput - see: developer.mozilla.org/en-US/docs/Web/API/HTMLElement/…
 
Why doesn't the second rows two <td> match the length of the table?
 
3:30 PM
@Doflamingo19 If the calandar is javascript produced, and upon clicking a date within it the input is populated, normal dom events won't help outside of detecting the click and figuring out the date that way. You'd need an event that the calendar plugin/library etc is throwing.
 
ok guys
 
(it very well could be re-throwing the onchange event on it's host input)
 
thanks for the answer
 
@BeerusDev - because, unless explicitly stated, each <td> is only a single <td> wide. To change that, add this attribute: colspan="2"
 
table rows/columns don't use flex
;)
 
3:33 PM
Derr
Thanks
 
3:59 PM
Is it possible to have a colspan of 1.5? jsfiddle.net/BeerusDev/tnfzLj7d/13 I cannot get them equal length
 
no
it is however possible to make every cell colspan=2, then make one colspan=3, to make it take up effectively 1.5
but controlling column widths that granularly... seems futile to me
 
4:17 PM
at a certain point, it's better to make it not a table
 
4:51 PM
Well, I have an odd number of cells so I am trying to figure out the best way to display the info
 
 
4 hours later…
9:07 PM
> How can i access the id value in this object? {id: "banana"}
 
9:28 PM
let data= {id: "banana"};
data.id
 
10:19 PM
I'm trying to upload a file to S3 from JS clientside and am getting a 403. I presign the url server side, get a File object f clientside, then run:
var options = {
  headers: {
    'Content-Type': f.type,
  },
}

axios.put(url, f, options)
This throws 403 (forbidden) -- anyone have an idea why?
 
 
1 hour later…
11:35 PM
posted on January 21, 2022 by Prudhvikumar Bommana

The Dev channel has been updated to 99.0.4840.0 for Windows,Mac and Linux. A partial list of changes is available in the log. Interested in switching release channels? Find out how. 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 common issues. Prudhvikumar Bommana Google Chrome

 

« first day (4115 days earlier)      last day (816 days later) »