Category "javascript"

How to use a third-party API inside next/api?

I am new to NEXTJS and creating a weather application .I am using a openweather api but how can I use it inside the next/api. I had tried by creating a file tod

Send file as buffer

const resp = await client.render(data); const Writable = require('stream').Writable; var buffer = []; const myWritable = new Writable({ write(chunk, encoding,

Is the jsconfig.json file required to be used in every JavaScript project?

I am working with a JavaScript project. Is it is necessary (or recommended) to use the jsconfig.json file in every JavaScript project? Will adding the jsconfig.

Flickity-fade slider not working after following the installation docs from github; flickity just run like the regular slider

I'm following this flickity slide fade docs FlickityFade Installation Here is the css cdn package <link rel="stylesheet" href="https://unpkg.com/flickity@2

Restarting Intro.Js tour from button?

Is there a way to restart Intro.Js from a button? I currently have it set up to run on page load with steps defined in JSON, which it does just fine. However, I

How can i use reduce or any other array method, to count and sum up specific properties?

I try to learn more about the array methods and also working with objects. I come up with this dummy example that simulate an incoming data. const data = [

Formik - Trigger validation from very first keypress

On the following StackBlitz I have a very simple form validation. The validation is done when the user clicks the submit button. https://stackblitz.com/edit/rea

Headings must have content and the content must be accessible by a screen reader

I've created a react web application which has an HTML body content inside home.js as below, class Home extends React.Component { render() { return ( <div&

RecoilJS RecoilRoot not accessible within ThreeJS Canvas

Hoping someone can help me out here. Im quite new to RecoilJS so if Im missing something obvious, please let me know. I am trying to manage the state of 3D obje

Drupal 8 form value not changing with javascript

I have a drupal form, which contains a title, username, email, ... and I want the user to be able to insert some values and submit the data. My problem now is t

Webscrap product price with javascript

im making a blog were i will show a product and all of it's prices on all the websites that sell this product, but i whant the prices to be up to date so i deci

Why does howSum solution work in Javascript but not in Python? (Dynamic programming)

This is a follow-up to this question asked on Stack Overflow. Write a function 'howSum(targetSum, numbers)' that takes in a targetSum and an array of numbers as

Get value from object of unknown content by key in typescript

I'm writing function that'll return single value from object by key or return empty object if key does not exist. Code: //example data: const obj = { data:

How can I format price in javascript?

I have this PHP code below which can format product price. I want to do this same task with javascript. Is there any way to do this same task with javascript? P

Exceptions while creating dirs with getDirectoryHandle in specific cases

Update: I raised a bug report in Chromium. Hopefully this situation can be fixed soon.     I'm trying to create a web app that can modify a directory

Bind JSON attribute with livewire

I have a Test model, with the JSON attribute inputs, which is a flat array of strings (e.g. ['foo', 'bar', 'baz']). I'm trying to bind this field up to Livewire

How to load 3rd-party scripts into a site using web workers

I have seen a lot about offloading large scripts from the main thread to help improve website performance and Google's Core Web Vitals. I am curious if there is

How to ping message author and user in Discord.js embed

i recently started with Discord.js and i am currently making a hug command. the command itself is working fine, but the problem i am facing is that i want the b

Dynamic Angular Forms on User Interaction

I have a dropdown that the user uses to switch between different Angular forms. HTML <form [formGroup]="evalForm"> <mat-form-field appearance="fill

Bootstrap 5 tooltip placement top issue when page has a scroll

I have an issue with tooltips in bootstrap when the placement top is forced. I use the latest version for now: 5.1.3 I have tried to create a code snipped, but