Category "javascript"

Sequelize dialect dependency on msnodesqlv8

We are using sequelize package to connect to mssql server. Our backend code is in javascript. We have a working code like below: const sequelize = new Sequelize

Function gets called only on the second click [duplicate]

I have a button that needs to execute a function. This function reads a json file from my machine and then parses it. It works all fine but th

Why is Swiper not working for me in angular?

I am trying to use Swiper but I cannot achieve it, I followed the steps in the documentation (https://swiperjs.com/get-started/), the problem is that all the im

(node:9374) Warning: To load an ES module, set "type": "module"

I just started to learn React today. How do I get rid of that error message on my Console in the Terminal in Visual Studio. (node: 9374)Warning: To load an ES m

Script from “http://127.0.0.1:5500/assets/platform.png” was blocked because of a disallowed MIME type (“image/png”)

Apologies if this is a repetitive question however I have looked all over and found no suitable solution for my particular issue. I am attempting to build a sim

Vue.js page inside iframe not showing on Firefox

We have a Vue.js page contains a Echarts pie draft, and we want to show it in another project, which is using jQuery. It shows perfectly both on Chrome and IE,

React: The best way to pass html attributes as props

For instance, I want to behave a Button as a normal button and enhance the component. <Button type="submit" className="btn">Click me!</Button> lead

TypeError: func.apply is not a function

I'm trying to use useEffect function like that: const [data, setData] = useState({ courses: [] }); useEffect(async () => { const result

React Router v5: history.push() changes the address bar, but does not change the page

I am trying to redirect a user to a new page if a login is successful in my React app. The redirect is called from the auth service which is not a component. To

eip.js - Basic edit in place plugin in jQuery

I'm using this edit in place jQuery plugin. I'm trying to set the Ajax request to the back-end server with details. But it didn't work, it seems the plugin eip.

Getting "Uncaught ReferenceError: i is not defined" error whenever I want to use an exported element from another file

I'm developing a chrome extension using webpack and babel. I have this popup.js: import 'regenerator-runtime/runtime' // This is required in every JS files that

How can I find the value from another value in the same line with JavaScript (JSON)?

I am trying to get the "correctAnswers" from a number. Here a is sample of the JSON: { "questions": [ { "number": 3, "question": "☀ʊ

Stopping timer at end of block using javascript

I am new to this. I have a Qaultrics survey consisting of different blocks; each block with its own timer. What I want to achieve is the following; if participa

How to use template literals of ES6 script

I have been trying to solve a template literal question on hackerrank. It works fine on my local IDE but giving error on Hackerrank IDE. Heres the code two add

Charts js - how to change the scale of y axis?

https://github.com/chartjs/chartjs-plugin-datalabels/issues/315 I would like to customize the bar cart height by changing the y-axis scale to fit the white spac

eip.js - Basic edit in place plugin in jQuery

I'm using this edit in place jQuery plugin. I'm trying to set the Ajax request to the back-end server with details. But it didn't work, it seems the plugin eip.

Getting "Uncaught ReferenceError: i is not defined" error whenever I want to use an exported element from another file

I'm developing a chrome extension using webpack and babel. I have this popup.js: import 'regenerator-runtime/runtime' // This is required in every JS files that

Stopping timer at end of block using javascript

I am new to this. I have a Qaultrics survey consisting of different blocks; each block with its own timer. What I want to achieve is the following; if participa

How I could use template literals in javascript in a variable name?

I want to declare a variable name via template literals How it is possible ? let z = 3; let test`${z}` = "hello"; //or = new obj() for example console.log

Turning a function based sketch object oriented

I am trying to take Dan Shiffman's prime spiral program and make it object oriented. I am putting all variables into the constructor and making the functions in