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

Do I need to unsubscribe from an Observable if the Observable is finished with?

Let us say I have an Observable (which doesn't complete), and I subscribe to it. Ordinarily when I am finished with the Subscription I have to unsubscribe it to prevent memory leaks.let subject$ = new...

View Article


Scroll to bottom of div automatically on page load

I have a chat application in react and have used npm package react-scroll-to-bottom until now. But it's not maintained and throwing warnings so i thought it should not be too hard to write this myself....

View Article


Can't grab a stored username in tag

I'm trying to make a chatroom and the username should be the same as the username you use when you log into my website which i store in a variable, I use the exact same code and that works but when i...

View Article

Unexpected end of JSON input at JSON.parse ()?

I don't know why this is coming up I've been watching a tutorial and it's fine when the other person does it. Im fairly new at coding, there is also another file i have in the folder with my core file,...

View Article

How do I make a draggable, sortable list display something else while it's...

I've been messing around with sortable lists with jQuery ui, and am unsure of how to temporarily adjust the element that's being dragged to something that's generic when dragging to sort.If the...

View Article


Dragging the screen to scroll

I am trying to drag the screen with mouse horizontally/vertically. I am able to achieve horizontal dragging with the help of this video : https://www.youtube.com/watch?v=C9EWifQ5xqA I tried the similar...

View Article

Google App Script setTimeout Function problem

I have a typical Google App Html form that records the data entered in a spreasheet. Here are the files.HTML Form:<!DOCTYPE html><html><head><base target="_top"><?!=...

View Article

Javascript: How to convert and map an object containing objects into an array?

In Javascript, how to map and convert this object: { 0: {k1 : v1}, 2: {k2 : v2} } to this array:[ { label: k1, value: v1 }, { label: k2, value: v2 } ] obs.: one-liners are nice, but all answers are...

View Article


I can't figure out why I am getting the following error "Error: Element type...

I am pretty new to React and even newer to Firebase. I am following a tutorial from Robin Wieruch on using React with Firebase. Clearly, there is something that I have done wrong but it eludes me. I am...

View Article


is there any equivalent for file uploading instead of using dropzone.js [closed]

I feel not productif when i'm trying to upload many images using Laravel 6.0 with Dropzone.js, also I get a lot of warning and errors in the navigator. Espacially dropzone doesn't work well. and can't...

View Article

how to use replace() method for a string just one time instead of mutliple...

str is an html string (or string that contains the full html) but with some unwanted codes in between that I tried to get rid off.This is what worked for me so far:const contentClean =...

View Article

Get only one parents of child in php or JavaScript

Here is my problem. I want to get grand parent or parent of my child. Please check below. Root A H B C I E F G J K Funtion getParent(data){ // Code is here return parent; } I tried but stuck in nested...

View Article

How do I find a specific path on the firebase realtime database then change...

Pop quiz, hotshot:You're building a react native app. You set some values to firebase as an object at the root of your app, like this:firebase .database() .ref("/companies/") .set({ awesomeCompany: {...

View Article


Return correctly the info in a javascript function

I want to use the date picker of jQuery UI but I don't know how to extract the info because I'm calling the datePickerRange() function but it's always returning object object.Below is the function that...

View Article

How to bundle every external and inline JS script within a HTML file

I currently have a project that has hundreds of external and inline JS classes.Index.html:<script src="./src/thing1.js></script> <script src="./src/thing2.js></script>...

View Article


vue-router why when I refresh a page that has a URL contains id, I lose all...

I am a redirect from the target component to target-details component using specific id, so my issue is when I refresh a page I am getting an error javascript Uncaught SyntaxError: Unexpected token...

View Article

Security error spawning web worker from Firefox extension

I'm experimenting with web workers. I'm trying to spawn one from a firefox extension. From my background.js:var myWorker = new Worker('moz-extension://myExtension@me/worker.js');...

View Article


Is there a way to multiply inputs when they begin with a decimal like this-...

I need some insight again. I am trying to multiply three inputs times two hidden numbers. Two inputs being the same number (since i have yet to figure out how to Square a input). The calculation i am...

View Article

How can I use getInitialProps only during the NextJS site build?

When using NextJS to build a static site, I would like the getInitialProps method to fire only during the build step and not on the client.In the build step, NextJS runs the getInitialProps method...

View Article

Remove first matching item in a collection

Given a collection, how can I remove only the first item that matches a condition?For example, given this collection:[ { id: 1, name: "don" }, { id: 2, name: "don" }, { id: 3, name: "james" }, { id: 4,...

View Article
Browsing all 138134 articles
Browse latest View live