Category "javascript"

Is it possible to use a frontend framework only on one page in an already finished project?

I'm working on a project where I need to make a dashboard as a homepage like this https://www.grapecity.com/wijmo/demos/reference-samples/DynamicDashboard/angu

Mapbox - Cannot trigger marker click with "element".click() after clicking on map

I've currently implemented custom markers on the map using the following code: // extend mapboxGL class so we can edit the click function class CustomMarker

How to filter multiple layers by same attribute in ArcGis with JavaScript

I need to filter features by one specific attribute which is same for every layer that I am using. I tried this tutorial https://developers.arcgis.com/javascrip

Calculate with minus/plus buttons

(Edit : up) First I'm a JS beginner. I need to make a calcul using both input type number and plus/minus buttons linked to it (to replace spinners on smartphone

How to remove HTML tag (not a specific tag ) with content from a string in javascript

Is there any way to strip HMTL tag with content in HTML example : const regexForStripHTML = /(<([^>]+)>)/gi const text = "OCEP <sup>&reg;&l

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