« first day (3923 days earlier)      last day (1024 days later) » 

2:22 AM
Hello
 
 
1 hour later…
3:46 AM
 
 
2 hours later…
5:53 AM
Hi there
I have little issued about js
HTML

`
<button onclick="ClickFun(this)">Click1</button>
<button onclick="ClickFun(this)">Click2</button>
`

JS
`
// output: click1.click2
function ClickFun(val){
  console.log(val)
}
`

I want output click1.click2 but this two click1 and click2 should come from
ClickFun clicking
how do I do it?
 
6:55 AM
Hello
 
 
1 hour later…
7:57 AM
Hello
How to separate static text to separate files in JS ?
  const texts = {
    localServer: `<p>
				a lot of text
			</p>`,
    notLocalServer: `
    a lot of text 1
		`,
    infractionReason: `
    a lot of text 2
		`,
  };
  return texts[key];
anyone ?
 
putting them in your source file seems like a bad idea to begin with
i'd use webpack and see if there's a loader where you can just import a .txt file to get its content as a string
 
8:19 AM
@MileMijatović what is the use case?
 
@KarelG coding challenge
 
 
1 hour later…
9:27 AM
Hello again
please check this error message in console
Uncaught (in promise) TypeError: this.userService.getUserByName is not a function

https://milemijatovic.com/
Please tell me why I am getting this error message
 
 
1 hour later…
10:54 AM
Hello! I'm working with a csv that I'm passing between pages. On the initial load in it calls my makeObject function that splits the csv into it's separate rows and cells. The first time it runs it's fine with no errors, but the second time it runs, getting the exact same data, it throws a `TypeError: Cannot read property 'split' of undefined` but still runs fine.

The data is the exact same, I can't really find any difference between the first pass and the second pass.
 
@SpencerCole 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
 
11:16 AM
@SpencerCole you have 2 .split calls
I guess that it's occurring within the loop. So there is something that leads to undefined. Up to you to figure out by debugging it
also csvData[i] = csvData[i].split("^"); is a fishy piece of statement.
better to assign it to another (new) variable
 
12:06 PM
Morning
 
What would be the correct error for a request which errors due to a another (not directly shown) database field is invalid for the request?
IE: for an order that is forced (sidestepped frontend error handling), however the shipping address in the user's profile is missing.
409: conflict?
 
I would say yes, but I feel like it could also fall under Bad Request
 
@paul23 that is not a network error. Don't mix application with network errors
conflict is when you've a concurrency system where multiple requests was sending a PUT on a same resource. The first one is ok, but the rest are 409's and the sender has to re-evaluate their request.
(with other words, the client application has to tell that changes got made and shows what the changes are. Is it ok to update that?)
 
Morning all, I'm having an odd problem.
 
my question is: is the shipping address part of the page you're sending request from? Or not?
 
12:20 PM
For various reasons I am using table-layout:fixed; as a CSS property. This is in a web application and I have limited ability to work on the layout of a form. Much of the CSS is specified by the application, but I have the ability to use javascript or jquery to change it.
 
if not -> ok request but tell missing shipping address
if yes -> bad request
 
Anyway, I am finding that when i use jquery to set the width of an input control, I'm being ignored. $("#CareNotesForm_WLSex").css("width","10px"). If however I use dev tools and specify width:10px then all of the inputs suddenly become 10px
anyone any idea why?
 
jquery is flexible, if there are no elements, it does not inform you about that. It just does nothing with the instructions (that .css ) you have given
are you sure that these elements you want to alter are present when that statement is being executed? With other words; when are you calling it?
 
@KarelG Well it can be, which would then overwrite the user address (new feature added, in the past it was a simple bad params)
it's at these points where network errors and application errors seem to become blurry
 
most sites use a "step" approach: order list -> contact + address info -> payment -> checkout
ah well, you can integrate the address on the same page if you can. Display the user's address as shipping. If he wants, he can alter that
(either by adding or updating)
lots of work tho
 
12:33 PM
yeah and then comes the point where you can order on behalf of someone else (already a thing), but then you shouldn't see that person's address (privacy).
also becomes really weird with error messages to the user now
 
we have a different checkout mechanism for that
but ... GDPR wise ... if that person cannot see the contact then he's not allowed to make that order!!!
we contracted a lawyer firm to figure out that one for us. The GDPR becomes so complex when you have external people working for you making/managing orders for other contacts
just tell that person "ordering for this user is not possible because its information is incomplete"
with an internal logging
 
ANnoying thing is that till just a little bit ago it was possible, so a lot of people are complaining to us but it's the payment provider which has updated to require those address fields now.
 
are we talking about shipping or invoice address?
 
uh the address that is on the bankroll paper
 
ah invoice
invoice address has been a requirement for ages. It is possible that they handled it themselves but won't do it anymore.
GDPR or cutting cost? Some platform offers an additional service to get invoicing address with card information only
 
12:42 PM
What you mean with gdpr or cutting cost?
 
our store allows purchases accross the globe and we're using three payment providers for that. One of them sent a mail to us that they are making the invoice address a hard requirement because of GDPR regulations. We provided these at our own already (internal accounting) anyways. So the documentation that impact was a quarter of an A4 sheet with a "none" 😂
 
It's basically third party sells some ticket through us, but the organizators can also sell tickets "on behalf" of clients of themselves (often a request made by them). But when I pay through ideal with a shop I often don't have to fill in my living address, but now the provider made it a hard requirement and fails on empty strings.
 
before, it was possible to just send the banking information. They will respond with the address at additional cost
 
I mean: I know I don't have to provide my address in the past with a lot of (dutch) shops in the past. So I myself am also a bit annoyed I have to update our stuff and make the workflow different for customers to stress that they have to fill in that information.
It's all digital tickets anyways.
 
still, for accounting, an invoice address is a requirement.
 
12:48 PM
But we'll live through it, I just have to make error messages and userflow updated.
 
fyi "on behalf" = on the customer (ticket owners) or that organisator?
if the organizator makes the payment -> invoice address = theirs
 
on behalf of the customer, basically what happens is that a customer (= member of the organisation) has come to the organizer and tells them "please provide me with a ticket for xyz, here you have the cash".
 
if a customer makes a purchase through the site of the organizator -> invoice address = customer's
 
Sorry - got dragged away. If table-layout is left at auto they work perfectly. It seems to be the way that table-layout:fixed works
 
@paul23 invoice address is then organizator's
 
12:52 PM
hmm but that would be really weird for refund policies.
 
normally seen, the organization is responsible to handle the refund.
if you have made a refund, you then invoice them to refund the sum
accountancy is a world with a lot rules you need to abide to. It happens that I am lost when our accountant "explained" something. Examples works :D
check with your accountant/legal person
 
Oh so that address would be the current logged in user's, at least something I can show back.
 
it is possible that your org and that other one has handled it in their contract(s)
hmm ... forgot what I was going to do ...
🤔
 
Still going to be painful have a semi requirement that peopel complete their profile. - Not to view anything but during payment. And for other things I already have quite a few more profile requirements.
I'm afraid we have to go back to the "long form of profile data that makes people shy away from the site".
Worst is that google just cannot seem to fill in address data correctly. It just isn't able to autofill forms on any site I ever visit and always makes the forms rubbish.
 
it depends of your visitors. When registering, we're satisfied that you're only providing basic information
only when you purchase something, we ask for more information. And for that we have that "step" approach I've told earlier.
 
1:01 PM
Like it adds my house number to the street name field(most often). Or breaks by using the postal code of one address and the street of another. (overwriting the auto complete of the site itself where it calculates street name from postal code)
 
that page has - as with account edit page - full validation
bah auto-complete
I gotcha blame the different designs on that. One wants house number being together with the street address in one input, another in two distinct inputs ...
 
it's always two distinct right?
 
not to mention that "addition" such as letters A/B/C ...
 
cause the postal code === street name and yo ucan hence verify if you typed code correctly by seeing your stree pop up
 
one does not bother with it, another wants to have it in the input for housenumber, and then another one as separate input
@paul23 in your country yes :P
we have multiple streets within one postal code
 
1:04 PM
what else are postal codes useful for if they don't uniquely define an address?
 
it does in your country (and I love it) but not in mine. Or France.
it's a smart decision that your gov has made in the past
the postal code here is just to represent a group of street names within a municipal
lemme tell you, we have lengthy streets that have multiple postal codes here and there :D
 
it's actually different for the side of the street: they are "sequential"/logical that follow up postal codes are the same route a postman would walk, so next code would not be the opposite of the road but rather a turn around the corner often.
 
reason is that they cross multiple municipals
 
@KarelG oh that's possible too, but postal code + house number (+affix +building number) is an unique ID for each adress.
 
 
1 hour later…
2:10 PM
Why won't this left .col div vertically align my text? jsfiddle.net/BeerusDev/vsqr3h19/31
 
you've set height on 25px with padding: 10px and has a text in it?
yeah that won't work
two quick things you can do: remove display: block and line-height rule
 
Lar
Oooh
I was playing with that for like 10 minutes
I have a question aobut JS classes.
Can I return two values?
class rps {
    playerOne = null;
    playerTwo = null;
    getPlayerInput(input) {
        if (this.playerOne) {
            this.playerTwo = input;
        } else {
            this.playerOne = input;
        }
        return this.playerOne this.playerTwo;
    }
}
Like so?
 
try it 😁
 
Lar
okay :)
 
js does not support it. Not many languages do
 
Lar
2:23 PM
Ohh, thank you!
 
If I specify the parent as display: table; and on the child I do vertical-align: middle; shouldn't that work?
 
return [this.playerOne,this.playerTwo]
 
@Lar there are simple work-arounds on that, it depends of your taste: use an array or object
 
Lar
@KarelG great idea! Thank you.
 
2:24 PM
Kevin has already given his regards :D
 
Lar
@KevinB thank you for the suggestion i will try it!
 
ohhi
 
Lar
Dude, you're funny! 😆
 
// assume you're returning an array
return [this.playerOne, this.playerTwo];

// then you can do
const [playerOne, playerTwo] = getPlayerInput(input);
...use.playerOne.or.playerTo...
@BeerusDev How dare you! A display rule with table! Get out. 👉 🚪
2
 
Oh it works with inline too o.0
 
2:27 PM
!!mdn beer
 
Lar
Aaahh, thanks man. I appreciate it.
 
|| starspam
james? o.o
 
did i break it
 
|| alive
 
james ded -.-
 
2:28 PM
@JBis can you switch account and play a healer?
 
Lar
Is there a way I can add pictures to a JSFiddle?
 
copy the image link
 
Lar
Aaahhh!
 
Hello
 
Lar
Hi
@BeerusDev Yo, I copied the linkaddresses of the pictures, how come they won't show up?
 
2:33 PM
That isn't the actual picture link that's why
 
Lar
ohhh!
 
Should end in a .png or .jpg or .svg
 
Lar
there ya go.
I am trying to make a rock paper scissors game, I made one, however I want a better look/reading one.
So at the moment I was wondering, how do I "active" the function?
 
getPlayerOption is not defined
 
Lar
Wait you have to define functions in a class, god that makes a lot of sense. I'm an idiot. thanks!
 
2:39 PM
is that onClick supposed to be getPlayerInput not getPlayerOption
 
Lar
That's emberrassing(?)!
 
Lar
On my end, I appreciate you're help.
 
All good
 
Lar
there now we can collab.
(if you want no pressure)
 
2:43 PM
In the middle of something, give me a few I will hop on
 
Lar
No problemo, take all the time you need.
im heading out, later
 
3:06 PM
That's the longest James has gone
he was an old man
|| status
 
I am currently alive!
 
Hiya
 
where'd he go
 
 
2 hours later…
4:55 PM
is there a way to ng disable a button in an ng-repeat based on a property from index +1?
i tried using ng-disabled="car[$index + 1].Model == 0" but that didnt work.
 
5:28 PM
hi
 
@Johnson 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.
 
o/
 
5:55 PM
!!mdn hex
 
not exactly
!!> (29).toString(16)
 
@KevinB '1d' Logged: [ ] Took: 0ms
 
6:12 PM
Anyone have an idea how to fix my issue?
 
posted on July 13, 2021 by Prudhvikumar Bommana

The Dev channel has been updated to 93.0.4573.0 for Windows, Linux and Mac. 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

 
6:31 PM
||> (29).toString(1)
 
@JBis 'RangeError: toString() radix argument must be between 2 and 36' Logged: [ ] Took: 34ms
 
6:53 PM
o/
SP has a way to redirect to another site after you open another url and follow that url by ?Source='newurl'. I have tried that through and through and it was unsuccessful, I found another post about a jquery script that can do it as well, and that doesn't work either.

Anyone have any suggestions?
 
!!magic
 
(∩ ͡° ͜ʖ ͡°)⊃━☆゚. * ・ 。 ᵀᴴᴱ ᴳᴬᴹᴱ
 
7:47 PM
!!the gathering
 
game
 
 
2 hours later…
10:06 PM
!!mdn magic
 

« first day (3923 days earlier)      last day (1024 days later) »