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

Image may be NSFW.
Clik here to view.

Toggle Color of Button Added To Favorites in React

I'm displaying a list of items and user has ability to add an item to their Favorites.My issue is that I'm only capturing one favorite state, thus, on click of one button, all of the item buttons (red...

View Article


valid json string but cannot parse

my environment is nodejslet z = await x.text(); console.log(z) let y = JSON.parse(z) the console log is...

View Article


Multiple .js calls from a local host

I working on an html file in which I need to call several .js files from my computer. Below is my directory structre. Dropbox/ ├── js/ | └── .js files └── abm.html I have the following lines in my html...

View Article

How to understand this Javascript shorthand expression?

I often seeing below type of expression in my current project. I need help here to understand this shorthand expression very clearly. this.open('GET', url) .send() .then(this.rejectError)...

View Article

Calculate previous working day excluding weekends and federal holidays in...

I am writing a function which will provide me previous working day for any given date. Working day means it is a weekday and there's no federal holiday on that day.My solution works when today (case 1)...

View Article


Table Data Grouping For Each Row

I am very new to JavaScript and would like to have table data grouped for each row. Each row has 6 table data. I would like the first 3 linked together and the last 3 separate. Creating a className for...

View Article

How to highlight the clicked item from JS fetch()

let div = document.querySelector('div') fetch('https://opentdb.com/api.php?amount=5').then(response => { return response.json() }).then(data => { div.innerHTML = `...

View Article

How can I script / automate node.js's node-inspector debugger by giving a...

I wish to input a set of commands to node.js's node-inspector debugger similar to gdb's --command flag: https://sourceware.org/gdb/current/onlinedocs/gdb/File-Options.html#File-Options. However,...

View Article


Add Print Media Query via JavaScript

I am currently trying to print a page that contains checklists & each list has a small textarea below it. When it's printed only the items that are checked are displayed, causing the checklists to...

View Article


Image may be NSFW.
Clik here to view.

Showing duration in Google charts vertical axis

Using Google Charts, I need to plot duration in vertical axis in hh:mm format. Since hour value can be greater than 24 timeofday is not suitable. <html> <head> <meta...

View Article

javascript slice without using built in method

What's the logic behind array.slice method? I am trying to implement a function to extract a segment of an array without actually using the slice method.function newSlice(array, begin, end) { for (let...

View Article

How to pass state to child component with function based React?

I try to pass uploaded file to the child component that both parent and child components are the function based. I am using React, TypeScript and Material-UI Parentsimport React from 'react'; import...

View Article

How Javascript exactly flows

Hi I am trying to learn JS.let currentResult=defaultResult; currentResult=currentResult + 10**3; let calculateDescription= `(+ ${defaultResult} + +10**3 )` outputResult(currentResult,...

View Article


How to transfer the received value from js to the $mypage variable of the...

By executing this code, I get a value - page number for example (2) I need to pass this value to the variable ($ mypages - which already exists) of the .php file so that it changes and refreshes the...

View Article

Creating forms to be embedded into external websites

I have a project where I need to be able to generate forms based on a record in the DB with a fields list. I have three requirements that I'm kinda stuck on what to do.I want the form to only be...

View Article


.scrollIntoView shifts page slightly to Left

I installed a .scrollIntoView element and specified the location where the content must scroll to, which is . However, when I test it on the website, upon clicking on the button that triggers the...

View Article

First Tuesday of every Month

Hello I am trying to use the following code which is a mish mash of "lifted code" but it keeps pumping out todays date and time. I am trying to get the date for the first Tuesday of every month at...

View Article


Linking External CSS's or a Image is not doing anything?

Whenever I'm trying to link a picture or a CSS style sheet, it is just not working. I'm writing the exact thing from the html tutorials I've been watching but its doesn't do any changes to the website...

View Article

How to tally occurrences of an object key without using for loop JS

I have been given this function and I would like to know how to count the number of people who live in a city without using a for loopfunction tallyPeopleInManchester(people) { /* This function...

View Article

Write to an existing file with only JavaScript [duplicate]

This question already has an answer here:Is it possible to write data to file using only JavaScript? 8 answersI have a JSON file located in my local. I need to read and write to the file with...

View Article
Browsing all 139805 articles
Browse latest View live


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