Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Browsing all 138221 articles
Browse latest View live
↧

Appending fetched data

I'm trying to build a treeview component in react where data for the tree is fetched based on the nodes expanded by the user.ProblemI want to replace the code inside handleChange with data from my...

View Article


Confused how createSelector works

I'm still new to javascript and I'm having trouble understanding how state is passed to createSelector and then to the input selectors. For example, in the code below we have a selector computeDiff...

View Article


Use jQuery to copy field

Case: I'm building a form using Formidable Pro and I want to copy the value of one field to another using this code: <script> jQuery(document).ready(function($){...

View Article

Camera control on phone not working for babylonjs vr

I can't manage to get the camera control to work on a phone using babylon defaultVRExperienceI can't understand what's missing. i've tried everything i can think of and i can't find any examples that...

View Article

Rock-Paper-Scissors game in JavaScript. Infinite loop issue

I am learning JavaScript through The Odin Project and currently stucked with the Rock-Paper-Scissors exercise. Program below works properly at a single round but when I add a for loop to the game()...

View Article


Computed prop in VueJS not updated until input lost focus

same as title says. A computed property from a object it´s not reactive until the input box lost the focus.But if the object is in data, the value changes as soon as changed in the input.I created a...

View Article

How to pass selector to onClick in React (Mapbox)

I am working with mapbox in a react application. Accordiong to mapbox docs you can target a layer on map click with code like this. map.on('click', 'poi-label', (e) => {// do lots of stuff in the...

View Article

Cannot find related JS from Html with Thymeleaf

I am trying to setup a simple application based on Spring. This is the current folder structure of my project:src | --main | --java | --resources | -- templates | -- Index.html -- Index.js My...

View Article


how we set marker label content by javascript in google map api?

I am using this code this code to change label text of marker label in google map api. But this code not working.var marker = new MarkerWithLabel({ position : latlng, draggable : true, raiseOnDrag :...

View Article


Is there a way to scaling a p5js sketch, while maintaining its pixel size?

I'm working on a project in p5.js where I need to be able to define obscure canvas sizes that are much bigger then my browser window. I essentially need to maintain a p5js pixel size (ex. 3840px,...

View Article

Reverse a string in JavaScript: Why is my answer not passing the test?

I am struggling with a JavaScript test, my answer isn't passing and I can't see why? Here's the question:Write a function that returns the reverse of a given string. Although many languages have a...

View Article

PHP laravel controller should not reload page

I'm having a weird little problem with my controller. I don't want it to reload my page. I don't know if this is possible but it is mandatory that my page doesn't reload when calling this function....

View Article

How can I store a ref in an array?

In my code, I have multiple components with each of them a different id. I need to attach each of them a ref. However, I get an error that says : TypeError: _this3.pinterestRefs.push Here is my code :...

View Article


Can't access an array inside an Object after passed props to a modal component

i'm building this application with the help of the RestCountries Api to be able to show each country with basic details on a grid, and after a click on each box the app will show a modal with more...

View Article

how to call function after get result of others functions?

I have 2 main functions, that sends order data to database in two different Node "I use firebase"So I want to call the second function after calling the first one In the first main function, I call...

View Article


Merge 2 arrays in change [duplicate]

This question already has an answer here:How do I zip two arrays in JavaScript? [duplicate] 2 answersI wanted to merge two arrays like you can fold 2 packs of cards - in ugly code with for loop and...

View Article

Copying an array from React Hook

I'm using the useState hook to populate items in an array.const [meals, setMeals] = useState([]); useEffect(async () =>{ const mealsData = await fetchMeals(localStorage.getItem('user_id'));...

View Article


How can I write an array values to different paragraphs in a html document...

Please, I want to print out the contents of an array to different blocks of paragraphs in HTML using javascript or jquery. I can console.log the problem but can write all individually to different...

View Article

AngularJs How to prevent tag being input

I allow a user to enter text using the following:<textarea ng-model="UserComment.text" rows="4" required maxlength="4000" /> Now this allows the user to enter <script>alert('Hello...

View Article

How do I properly return immutable data from a react redux reducer

My react redux setup was working well until I needed to trigger a component update based on an update to a redux store variable. From research I feel that my issue is that I am not returning from my...

View Article
Browsing all 138221 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>