Category "javascript"

Refused to load the script 'https://apis.google.com/js/api.js' because it violates the following Content Security Policy directive

I want to add google api in my popup.html but there is an error in cosole Refused to load the script 'https://apis.google.com/js/api.js' because it violates the

React - Cannot find module fs and require is not defined

I am using React to build a web app. I never called fs in a file and everything worked fine until I suddenly got this error: Uncaught Error: Cannot find module

How to make a .env file in Vanilla js and hide tokens in them

I have a vanilla js project. In app.js file I am calling a api that retrieves the desired values. I have initially called the api through postman, included all

Type '{ author: Author; }' is not assignable to type 'IntrinsicAttributes & Author'

I am totally new to TS and react and I ran into a problem. I tried searching many places and can't seem to fix it. The whole error message is: Type '{ author: A

moment.calendar shows today as the day instead of 5 days ago

I am using moment version 2.24.0 (I did have an older version but updated to see if it fixed this problem, which it didn't), in Angular application. I have the

413 payload too large, for base64 string after adjusting size in express

I have tried to make a post request, to my node server, with a base64 encoded file. I get a PayloadTooLargeError: request entity too large exception, so i wen

Is there a JavaScript / jQuery DOM change listener?

Essentially I want to have a script execute when the contents of a DIV change. Since the scripts are separate (content script in the Chrome extension & webp

How can I optimize a popup Javascript code?

I'm just starting with Javascript and I made this popup code, and I was wondering if there's another code with the same result or a way of optimizing the Javasc

js/ts translate internal commands

I am currently trying to translate some text-based console-log processing into JSON format. Console.log commands: give ENTITY.name = "entitytest"; give entity.u

How to map key/value pairs of a "map" in JavaScript?

How to map key/value pairs of a "map" in JavaScript: var map = {"a": 1, "b": 2, "c": 3}; alert(JSON.stringify(map)); I need to get an mapper containing key/

how to call actions from pinia store?

How I can call action from pinia store in vue 3 component? I use composition API. For example, I would like to import 'openLessonCard' - it is action in pinia s

Cannot install with npm package from git

I am trying to install package from git, which I forked earlier. I try npm i catsaredoomed/invest-openapi-js-sdk --save-dev I've got npm ERR! prepareGitDep 2&g

Wordpress Elementor: Expand/Collapse on hover on accordion

I am using wordpress with the elementor add on. Though it provides very sleak accordion which works perfectly on click, I wanted to expand/collapse the accordio

What is the difference between Shopify checkout liquid template page:load event and DOMContentLoaded?

Shopify checkout liquid offers an event called: page:load Documentation: page-load Unfortunately, the documentation is sparse. What is the difference between p

How do I solve the problem that other events cannot be applied when using blur in JavaScript event?

const selectBtn = document.querySelector(".btn-select"); const langUl = document.querySelector(".list-member"); const options = document.querySelectorAll(".

Safe regex patterns from ReDos attack

I've recently faced with some redos attack issues. Explain in simple steps: Regex denial of services: it means the attacker can put some malicious/crafted input

My tilt js is not working the card is not tilting need help within 4 hours

So guys I have created a website and in that I have a card hear is its html code <div class="about-indiamain" data-tilt> Main Content</

How do i make a third scene for the menu screen?

(All in JavaScript) I need help, I am an absolute beginner in coding, I am currently learning at Khan Academy and was in the making of a new project: a menu scr

I need to apply a 24hour cooldown after use, and add to the token balance on a correct answer (discord.js v13)

Here is the challenge bot slash command: const { SlashCommandBuilder } = require('@discordjs/builders'); const { MessageEmbed, MessageAttachment

create table from JSON object in react

I am creating a table dynamically in React with the API response as it is as it receives. data = {"name":"tom", "age":23, "group":null, "phone":xxx} It is work