Category "javascript"

Telegram Web Bots data validation in JavaScript

I've tried to do user verification script for telegram web app for bots. I have no idea how to fix it. import sha256 from 'js-sha256' const telegram = window.T

How to use BootstrapVue's layout and grid system to arrange these checkboxes?

I have a BootstrapVue table like this; Here's the code for the table; window.onload = () => { new Vue({ el: '#app', computed: { visibleField

How to use this keyword inside eval in javascript?

Having this: const person = { name: "James Smith", hello: function (x) { console.log(this.name + " says hello " + x); } } function newContext() { t

Why does the canvas have a black background?

Why does the below canvas have a black background? Because of it, the text behind the canvas is not visible. I need it to be transparent to show the elements be

User defined renderer object causes a TypeError - marked.js

Right now I'm familiarizing myself with marked.js. I want to add html attributes to the elements that are rendered when marked.parse() is called. In doing so a

Transform array into object with custom properties

I have this array myarr = [ '=title1', 'longText0...', 'longtText1...', '=title2', 'longTextA...', 'longtTextB...', 'longtTextC...' ]; symbo

Props object not working on mounted method

i have preFile variable whitch is coming from props and i am changing on mounted method but when i try to use preFile to pass fileProcess method, for is not not

Django and Axios Forbidden (CSRF token missing or incorrect.)

I am having issue with my django server when trying to connect it to axios. It should be a simple fix but I am stuck! I am getting this error from my django ser

Updating a Dropdown Based on the Selection of Another Dropdown - replaceWith Not Working

I have a couple of drop downs, when a venue is choosen from the first one, it should populate the second drop down with floor values. Using jQuery AJAX I am abl

Cannot update a component while rendering a different component warning

I am getting this warning in react: index.js:1 Warning: Cannot update a component (`ConnectFunction`) while rendering a different component (`Register`). To l

How to get target who are touching on a specific sprite

I am trying to make a mini-game by phaser.js. In my idea. A sprite object can collided to a static sprite and continually perform desired effect if they are sti

Configuring Jest with Rollup and Typescript

I created an app within a monorepo (Lerna) using yarn workspace. The architecture of the app is as follow: my-monorepo ├── node_modules ├

Validating Firebase Auth tokens manually

I'm trying to use cloudflare workers to perform authenticated actions. I'm using firebase for authentication and have access to the Access Tokens coming through

NextJS next/image Failed to parse src with Strapi 4 and Graphql

I'm not able to load the images with the next/image handler from the strapi cms. the images are working perfectly with the normal tag but not with the next/ima

Creating an experimental stimuli in JsPsych

I am a beginner in jsPsych and am trying to build an experimental task in which there will 3 boxes within which there will be a bar with varying values. The box

How do I build a Regexp that doesn't care about positions

I'm making a Scrabble game with HTML and Javascript and I'd like to add a "hint word" feature based on the player's rack. I have a dictionary array with the val

Regex to filter out Datetime time from string

Requirement: I am receiving an email with a template and I need to filter out some text from the email. I am converting all the email body text as a string. ema

Calculating a matrix to invert a "flattened" 3D rendering context

Context: In my web app I create several groups of elements all positioned relative to each other in 3d space. All elements have transform-style: preserve-3d. A

Dockerfile: Cannot find module '/usr/src/app/dist/main' - Dist folder does not exists on container

I'm having the following error when trying to execute my NestJS App with Docker: > [email protected] start:prod > node dist/main node:internal/modules/cj

Is it possible to append to innerHTML without destroying descendants' event listeners?

In the following example code, I attach an onclick event handler to the span containing the text "foo". The handler is an anonymous function that pops up an ale