« first day (3748 days earlier)      last day (1184 days later) » 

Rob
12:06 AM
hey guys
 
@Rob 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.
 
Rob
i have a method that expects an array as an input. Wheni input an harcoded array like this for example [1,4,6,8,9] versus an variable of an array like this for example data = [1,4,6,8,9] they react differently
so my question is is there any difference in these 2 types of arrays?
i know such a wierd question
i dont wanna get to deep into it because it is pretty complex to explain but is there any known difference somehow
 
12:26 AM
if I have a date with format 20021112 how can I create a new Date()?
 
Rob
12:38 AM
@Rob No, they're the same
There's a 99% chance what you think is in the variable is not what's actually in the variable when it's passed to the method
 
(I used moment.js)
 
 
2 hours later…
2:48 AM
Guys, can we pass an enum as an argument to a function?
 
 
4 hours later…
6:42 AM
@d4rk4ng31 JavaScript doesn't have enums. If you mean TypeScript then yes, it's possible.
 
 
1 hour later…
7:49 AM
Hi All
im trying to fetch data using v3 youtube api
youtube/v3/channels?part=snippet&mine=true&key=
this works fine on my production but when i run the same from localHost, i get the below error
Request failed with status code 403
status:403,
statusText:Forbidden
message: The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.
 
Sounds like there is a quota on requests. And you've exceeded it. Some APIs rate limit the amount of requests they allow. Your production might have a key for additional/unlimited request. It's also possible that it doesn't but your local machine is exiting from the same IP as the machines of a dozen other developers (and/or machines that run automated test against the API) and you've collectively used up the quota, whereas production doesn't get enough traffic to exceed it yet.
 
8:16 AM
Why doesn't this code make the width of the search bar same as the header?:
@model SearchModel
@section scripts{
    <script type="text/javascript">
        let width = document.getElementById('header').offsetWidth();
        document.documentElement.style.setProperty('--width', width);
    </script>
}

<head>
    <style>
        :root{
            --width: 0px;
        }
        #search-bar{
            width: var(--width);
        }
    </style>
</head>

<body>
    <form method="get">
        <div class="form-group">
            <input id="search-bar" asp-for="@Model.SearchString" value="@Model.SearchString" class="form-control" />
I Even tried using:
@model SearchModel
@section scripts{
	<script type="text/javascript">
		let width = document.getElementById('header').offsetWidth();
		document.getElementById('search-bar').style.setProperty('width', width);
	</script>
}

<body>
	<form method="get">
		<div class="form-group">
			<input id="search-bar" asp-for="@Model.SearchString" value="@Model.SearchString" class="form-control" />
		</div>
	</form>
</body>
But still to no avail :(
 
8:56 AM
CSS variables don't work inline do they?
Hmm, guess they do
 
@VLAZ, the quota limit when i see is 10k, and that much is not used yet.
one question i have related to below API
youtube/v3/channels?part=snippet&mine=true&key=
i use this api to get information, and save some important info in my DB with the logged in user of my application.
i want to make sure that, one youtube account is connected with only one user account.
 
@BenFortune umm...?
 
@d4rk4ng31 What?
 
Scenario:
User 1 connects with account : SyedSuhail121@gmail.com
User 2 tries to connect with : SyedSuhail121@gmail.com
 
@BenFortune I... didn't get you comment😅
 
9:09 AM
@TheJOKER That's an invalid email
Do some checks
Also you'll never be able to get around those, since a.b.c@gmail.com and abc@gmail.com and every other variant all go to the same address
 
on repeated login, i see that etag is the property that has the same value everytime i connect to youtube account
"etag": "mmffxyp7Izep-VgY2_XEG4UTRbo",
 
abc+foo@gmail.com
 
@BenFortune its just an example
 
@BenFortune, so what's wrong in the code? I am kind of a newb, when it comes to JS
 
fairs
 
9:11 AM
how do i validate that a particular email is already have reference.
 
Does the API return an ID tied to the account?
Also quotas are applied on the hour/minute too IIRC
If you're doing too many calls in a minute
 
"youtube" : {
        "kind" : "youtube#channelListResponse",
        "etag" : "uaCnjZa74a61JDrxkmrkIQvleT1",
        "pageInfo" : {
            "totalResults" : 1,
            "resultsPerPage" : 5
        },
        "items" : [
            {
                "kind" : "youtube#channel",
                "etag" : "MjzjROU4dO9E9cOasO7C8ABokvV",
                "id" : "UURyvbKDhPx4psxunmao1a4c",
                "snippet" : {
                    "title" : "Syed Suhail",
                    "description" : "This is a gaming channel",
@BenFortune this is what i save in DB, and what im thinking of is, whenever another user tries the same email, i should check some unique property in my DB, and if it exists should return as already connected.
 
@TheJOKER You can use the etag for that
But you should be able to use the id to identify if it's already connected, and use the etag to confirm if the db should be updated
 
9:37 AM
@BenFortune the id field will come if the youtube has a channel created
if the channel is not created, then the youtube response would be like below
"youtube" : {
        "kind" : "youtube#channelListResponse",
        "etag" : "uaCnjZa74a61JDrxkmrkIQvleT1",
        "pageInfo" : {
            "totalResults" : 1,
            "resultsPerPage" : 5
        },
       "isActive" : true
    }
 
 
3 hours later…
12:31 PM
I am glad to know that if it is possible - I am trying to Crop the image before uploading an image on server. Click on the File Browse button, click on Preview Image -> Crop button and crop the image. I can't find a way to update FileReader() after cropping with cropped image
 
1:14 PM
@KevinB how is it a complicated mess
 
 
2 hours later…
2:48 PM
@bigchungus Check the source of any graphing lib and you'll see how many hacks are there
 
3:05 PM
Hey guys, I´m have to make a web request where the post body should be like that: input={"id":6623,"params":"{\"WORKER_\":false}} but when I put this string in javascript the string in the body looks like that (because javascript escapes the dash): input={\\"id\\":6623,\\"params\\":\\"{\\"WORKER_\\":false}} - end that means that my request becomes invalid - how the handle such things?
 
@Niklas 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.
 
user13780186
3:28 PM
Hi dev
 
user13780186
I would like to ask about the react which is better to use for the charts. Echarts or recharts?
 
user13780186
Any suggestion?
 
user13780186
Cause I'm looking for a package which is less memory also good
 
4:03 PM
posted on January 19, 2021 by Nicholas C. Zakas

When promises were introduced in ECMAScript 2015, they had an interesting flaw: if a promise didn’t have a rejection handler and was later rejected, you would have no idea. The rejection silently occurred behind the scenes and, therefore, could easily be missed. The best practice of always attaching rejection handlers to promises emerged due to...

 
 
4 hours later…
8:02 PM
posted on January 19, 2021 by Srinivas Sista

 The Chrome team is delighted to announce the promotion of Chrome 88 to the stable channel for Windows, Mac and Linux. This will roll out over the coming days/weeks. Chrome 88.0.4324.96 contains a number of fixes and improvements -- a list of changes is available in the log. Watch out for upcoming Chrome and Chromium blog posts about new features and big efforts

 
8:14 PM
That's the one that force-blocks Flash no?
 

« first day (3748 days earlier)      last day (1184 days later) »