Category "javascript"

Firefox extension DOM change weird behaviour

It's my first time trying to learn Firefox extension development. To get started, I'm trying to make a simple extension that alters some parts of the youtube.co

JavaScript: match a word in a text with a word in array and replace it

I need to change this text: var text = `this is an example text. 1coffee , 2 coffee , 1 apple, 2apple , ?banana ,carrot`; using these 2 arrays : var arrOld = [

Leaflet.js Polyline from an array of LatLng points - remove/hide part of points connection based on distance

I'm new in Leaflet and I need to add a red polyline using an array of LatLng points like var latlngs = [ [45.51, -122.68], [37.77, -122.43], [34.04, -118.2] ];

RegExp constructor adding unexpected comma to pattern

trigoOperators is an array containing some trigonometric operations. The goal is to create a regular expression that parses a string equation into an array. The

PM2 only auto restart between specific time?

Not sure how to make pm2 run a Javascript that restart at 23 PM 59 sec everyday then enables auto restart for 10 mins to next day's 00:09 then no-autorestart fo

Bootstrap-treeview : How to close child and grandchild when the page load in treeview

Currently my treeview is like this , when the page load it opens the child tag. how to keep the child tag closed when the page load. when the page load Menu 1 n

Why do JavaScript's settimer/setInterval drop when there is an identical timer in the task queue?

I'm studying JS timer and recently I read this page https://johnresig.com/blog/how-javascript-timers-work/ Please note the following in this article. Note that

Async function not running some code even inside await

I have a Node.js AWS Lambda function created via the serverless framework. I have multiple helper functions inside it. I am having an issue with one of them due

Arrow style over the text using css

I am trying to apply an arrow style on selected ul, li elements. However, I am quite sure how to do that. So far I am able to do this below is my code. .a

A Fix For A Flash Of Unstyled Content That Cancels Out Javascrpit

Below is the javascript that I'm using on my website, part of which is used to get rid of a flash of unstyled content when loading a web page. Part of the check

How to append to second last line in a file in NodeJs

I want to append to second last line of a file using NodeJs! I hope I am making sense. Thanks in advance My current code which appends to end of the file: fs.ap

how can i implement or convert a python code to javascript to be used with tensorflow js

how could I use this code in python with tensorflow js? it is to occupy it with a model that was trained with the dataset tf.keras.applications.ResNet152(input_

Instruction 0: incorrect program id for instruction. Works on devnet but not mainnet

I am trying to make a spl-token transfer from a user wallet. The code below works perfectly on the devnet but throws Transaction simulation failed: Error proces

Axios POST with the server responded with a status of 500 (Internal Server Error)

I'm using ReactJS to build a blog app. I can use axios get, put, delete but NOT POST. Every time I post a new blog, it gives me server responded with a status

Change node style based on name / label

I'm using vis.js to visualise a network. The network is created based on the DOT language (Directed graphs). An example: 1 -> 1 -> 2; 2 -> 3; 2 -- 4; 2

Why am I getting this MySQL error with node?

I have connected to the database on MySQL, and was able to input data to a table. However, I am not able to input data to another table when it seems that I'm u

Why am I getting this MySQL error with node?

I have connected to the database on MySQL, and was able to input data to a table. However, I am not able to input data to another table when it seems that I'm u

Unmarshall of string set in DynamoDB fails

I have tried to marshall DynamoDB's String Set and unmarshall it back as below. import {marshall, unmarshall} from '@aws-sdk/util-dynamodb'; test('Marshall and

File reference in Chrome extension

I would like to load a model in contentScript.js using url './model/model.json' const MODEL_URL = './model/model.json'; const model = tf.loadLayersModel(MODEL_U

Css and Js not working after deploying the next+react project to server side

I have React+next and node js projects I want to deploy that project in one port. For that, I created ts file to js and ran the. next folder to the backend side