Questions tagged [javascript]

JavaScript (not to be confused with Java) is a high-level, dynamic, multi-paradigm, object-oriented, prototype-based, weakly-typed, and interpreted language used for both client-side and server-side scripting. Its primary use is in the rendering and manipulation of web pages. Use this tag for questions regarding ECMAScript and its various dialects/implementations (excluding ActionScript and Google-Apps-Script).

Filter by
Sorted by
Tagged with
0
votes
0answers
3 views

React native video player error for wrong size

I am facing a issue in react-native-video-controls First of all here is my code for a single item of the Flatlist renderItem = ({item, index}) => { return( <View style={{width: ...
0
votes
0answers
3 views

Parse image pixel coordinates from URL

Is it possible to parse a image's pixel coordinates from a URL? Possibly log each pixel coordinate and the hex value of that current pixel index using variables and forEach? var pixelcoord = foo.. ...
0
votes
0answers
6 views

Laravel url call usein javascript

This is my Laravel route Route::get('upload-question/{sugg_id}/upload/{question_id}', ['uses' => '[email protected]', 'role'=>['admin'], 'as' => 'upload.question.store']); I'm using the ...
0
votes
0answers
6 views

Building an application .APK with electron.js ? Possible?

i would like to create an application for drawing. I want to use ELECTRON.JS with html/JAVASCRIPT/CSS. But i'm asking myself a question : is it possible to put my app on the GooglePlayStore ? Is it ...
1
vote
1answer
23 views

is it possible to seal JS objects automatically?

I want to seal JavaScript objects as soon as they get created: 'use strict'; class Test { } const t = Object.seal(new Test()); t.p = true; // error! Is there a way to do it automatically, ...
0
votes
0answers
7 views

Checkbox list in Angular reactive/dynamic form

Trying to build out a reactive/dynamic form using Angular8, strugglign with rendering a group of checkboxes. I've followed the tutorial at https://angular.io/guide/dynamic-form, and have it up and ...
0
votes
2answers
19 views

html css jquery modal doesn't open in browser

I am trying to create a modal window when a button is clicked for registering users.I don't know what is wrong. The button gets clicked but modal window doesn't open. My code is like this <...
0
votes
0answers
10 views

How to resize shapes drawn on map based on zoom value with react-native-maps

I am using react-native-maps to integrate maps in my application. I want to show some sort of radar heading the direction the user is heading, i want to area covered of different distances like 1 km, ...
0
votes
0answers
9 views

(sqlite3.InterfaceError) Error binding parameter 4 - probably unsupported type

I'm not sure which part of the code is giving me the interface error. Any help is appreciated. This is what is being inserted that's not being passed through correctly: [SQL: INSERT INTO minutes (...
0
votes
2answers
27 views

How can I set length limit on Local Storage?

I want to limit Local-Storage length on just 5. So I made some Code. But I don't know how to deal with length limit. Already tried to use if ~ else in JavaScript Code. I think I have to use if ~ else....
0
votes
0answers
16 views

How to use Ajax on Laravel?

I made a JavaScript code to process my request search request using Ajax. So thus, my code is defined as the following: if(document.getElementById('category')){ document.getElementById('category')...
1
vote
1answer
9 views

How to change the data of an existing D3 visualization and perform a transition?

I have created a visualization elements with the following code and it display everything as expected: var linkTopicComments = vis.selectAll(".linktopics") .data(topicLinks) .enter().append("...
0
votes
0answers
11 views

Shallow mock extends React.Component<MyInterface,any> showing error

Getting below error while mocking component. Conversion of type '{ props: { index: number; AssignmentTitle: string; AssignmentDescription: string; AssignmentUtilizedHours: string; ...
0
votes
1answer
15 views

How to Image Crop And upload to Folder And Save Name in database Using Ajax And Jquery In Php

I want to crop And rezize Image and Upload In Folder For user registration and profile updations.Upload and Crop Image using PHP and jQuery. HTML Form with Image Upload Option with JQuery Croppie ...
0
votes
0answers
20 views

Reason behind placing undefined as a property to window object?

In JavaScript, there is a property undefined for window object. What is the use or reason for that. What is the problem in placing undefined independent as null. We cannot find window.null.
0
votes
0answers
14 views

Reuse multiple existing IIFEs in react app

I have IIFE functions for some of the library code in an legacy application that needs to work for IE10+ (No ES6 module loading, etc). However, I am starting to develop an React app that will be ...
1
vote
0answers
16 views

How to reverse a @keyframe animation on mouse off?

I need to reverse the wipe animation when the mouse moves off the button. Is there a way to do this in only CSS? I know I can reverse the animation, but I'm not sure where to put in the CSS file in ...
1
vote
1answer
26 views

(Javascript) Trying to allow a key press only once in hangman game when it is deemed to be incorrect

Please let me know if there is any additional information I can add to help make my problem more clear! Im trying to get my hangman game to not allow another key press of the same kind if it is ...
0
votes
0answers
8 views

How to solve encoding when piping file from NodeJs Cloud Function?

I'm attempting to pipe a file in Firebase bucket through a nodeJS cloud function to the client (browser). The client will use file-saver.js to start the download on the browser. This works well with ...
0
votes
0answers
10 views

Issues Embedding Instagram posts in React components

The issue I'm running into is that the picture from any given IG post is not showing. What's showing up is the faded user caption/symbols, and the "view this post on Instagram" caption. My assumption ...
0
votes
0answers
5 views

Sailsjs Javascript method not triggering on Modal button click

I am developing a Sailjs web application. At one place I have to show a modal window (bootstrap 4 modal-dialog class) showing a list of items to choose from. In addition to the 'Close' button, I added ...
0
votes
0answers
22 views

React hooks - How can I return a hook call from useMemo

Codesandbox link This will crash the sandbox browser tab pretty quickly https://stackblitz.com/edit/react-hook-form-use-memo You can see it better here. Just make sure to open the inspector before ...
0
votes
1answer
19 views

var x=document.getElementById(“mytext”).value;Why i change the value to innerHTMl or innerText,it do not work?

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <input type="text" id="mytext">...
0
votes
1answer
21 views

mapping json from a fetch function into setstate

I am trying to map a json response into a state, what I am trying to do is map all the children of this array no matter how many, as in skipping the first array and only show its children, here is ...
1
vote
0answers
16 views

How to deploy a static website to AWS S3 using nextjs [Please save me]

I am still new to React and I started writing a static website using Nextjs. But when I want to deploy to AWS S3 I have some problems. I used to use webpack only and when I type yarn build I get a ...
0
votes
1answer
22 views

Make height of list fill whole page

I am currently trying to make a page with a map on one half and a list on the other. I want to make the list height fill the entire page but I can't seem to find the right way to do so. I am using the ...
-3
votes
1answer
22 views

Chatroom application

I was wondering how I can create a local chatroom using a website / app that connects to a server which will only allow the users that are connected to the router(LAN) to be able to chat.
0
votes
0answers
10 views

How do I stop Javascript Foliotek's Croppie from overwriting previously cropped and uploaded images on the same page with the latest uploaded image

The scenario is I'm uploading and cropping up to 4 images to a page. Once an image is cropped, it will appear on the page. However, when i go to upload and crop a second image, this second image ...
0
votes
2answers
31 views

Using Filter Method to Remove Item from Array

I am new to React and I am trying to build a very basic timesheet tool, where users can add tasks into the application and save. I am using React as well as Typescript. So far I have my main ...
1
vote
3answers
36 views

How to detect changes in input text field and enable save button

I am trying to code a function where it detects changes in the text field and enables the save button. This is running in Visual Studio 2017, HTML , JavaScript (function () { var ...
0
votes
0answers
12 views

Cart Array is not updating correctly

I have a cart object with property items[] and want to update the ui when the user added a product button and the view cart is clicked a div is open with all the products in the cart.items[]; I ...
1
vote
1answer
22 views

Fetch data in array's order

I have an array which contains a list of IDs. With it, I'm trying to fetch some posts data from the WordPress REST API. I managed to retrieve the data I was looking for, but the issue I'm running into ...
0
votes
4answers
29 views

Is it possible to make a function that can manipulate the object inside a particular function?

Lets say we have a function that has an object inside it and more : function myFunc() { var obj = { "one" : "1", "two" : "2" }; // And more code is down here but our main focus is ...
0
votes
0answers
14 views

wordpress website, using cloudflare as CDN, CSS on the live site keeps disappearing and sometime css classes does not work when i inspect the element

I am working on a wordpress website, using cloudflare CDN. I have dev, staging and live site, where dev and staging works perfectly fine but live site works very weird, CSS on the site keeps ...
1
vote
0answers
25 views

Get an object with null values from an array of nested objects

I have an array of nested objects. How do I get an object with null values using only a particular key in the array of objects? let headers = [{ title: 'Arun', id: 'arunId', ...
-1
votes
1answer
17 views

TypeError: Cannot read property 'includes' of undefined: using a command Array in discord.js

Making a discord bot might get tagged as duplicate but I can't find anything that fixes this sort of problem. With this code: client.on('message', message => { if (!message.content....
-4
votes
0answers
10 views

Нажатие кнопок направления не срабатывают на js

Трудно разобраться в одну сторону кнопка работает (в правую), а в другие нет. Не передвигается именно объект который должен перемещаться по логике вещей. Сама кнопка работает, потому что можно ...
0
votes
1answer
19 views

JavaScriptExecutor + WebDrive com erro: Cannot read property 'click' of null

Edited to english I am browsing a page that ** I do not have edit access ** and need to click on a text that references a JavaScript function. Navigation using Selenium WebDriver; Using ChromeDriver;...
0
votes
2answers
18 views

How to display objects within an array if they have a certain value?

I am plotting cities on a map based on their object values. I need to be able to have these plots hide or show based on their values. So far, I have the following, which will toggle all cities on or ...
0
votes
2answers
19 views

JavaScript snippet to make visual changes based on audio playback

I'm trying to write some JS that will change a square from blue to yellow if the audio has played for a second or more. Currently, no change seems to happen at all. This is the first bit of JS that I'...
-3
votes
2answers
36 views

Why am I never entering the for loop?

This is super basic, but I cannot figure it out. I'm never able to enter this for loop. this.state.things is defined, so that is not a problem. getThingsToRender(){ let thingsToRender = []; ...
0
votes
1answer
30 views

Add missing keys, values and data to json object

I have a large piece of json data that dynamically change but. Each JSON Object has a date, site_nm and more values. The dates dont match for all. The distinct dates in this dataset are: 2019-10-01,...
-2
votes
2answers
32 views

Index Item Alterer

Could someone help me out here? I'm trying to create a small javascript code snippet that selects a random item from and array and alters it to be either 'A', 'T', 'G' or 'C' (dna strands) but it ...
-1
votes
0answers
8 views

Product comparison from JSON with Vue

I am working on a product suggestion webapp in Vue. I am pulling data from a Google Sheet via a JSON api. The data is a list of products, our products and competitor products. They all have the same ...
0
votes
0answers
15 views

Electron and React; detecting electron api changes in react with electron remote

I am trying to change the style of a div tag dynamically when the electron window is maximized. In the code below I want the div class=resizer to display: none when the electron window is maximized. ...
1
vote
1answer
28 views

Illegal Character. At line '4' position '6' JavaScript Error

I've been trying to minify one of my script and all the minify tools that I've tried gave me this error. Error I get on Minify Tools: Illegal Character. At line '4' position '6' This is the code ...
0
votes
2answers
31 views

Unexpected behavior when using the same component twice in React

I have two objects incs and exps each has the properties: desc, amount and id. I would like to display the details of each object in a container as a list, and the two containers are side-by-side. I ...
0
votes
2answers
30 views

Cannot select element in the DOM

This is my index.html: <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body> <script ...
0
votes
0answers
18 views

How make it works a function on a single header in AngularJs

I'm working with AngularJs, and i want to use a single header over all my pages. For the pages, i'm using ng-route. Right now, i want to make a test for the logout button (which lives in the header), ...
0
votes
0answers
9 views

Why is my (xbrowser plugin-created) height equalizer javascript showing up as text?

I'm helping out with a company's WP site (read: I didn't design it). There is some JavaScript showing up at the top of each WordPress site page. Usually this would seem like a simple fix: verify the ...