I am using jQuery to target anchor elements within an SVG image I have created to get the value of the href assigned to the anchor element. I am then trying to toggle on and off a piece of content that has an HTML ID identical to the href of the anchor element. I am facing a problem when I
Tag: javascript
Return Observable From Promise That Gets Rejected
I’m trying to determine how/if I can convert a Promise rejection into a typed Observable. I have a login component with a function like this… and an authentication service with a method like this… How can I return an Observable<Credentials> if the Promise resolves, and bubble up the er…
Change Array[3] for every item in other array
EDIT Made a mistake in my question. The let tempArr = splitArr is wrong. This needs to be: tempArr = car. So the awnser of @Prime and @sabbir.alam does the trick! I have a array of values where one value (car[3]) of the array is a string seperated by “, “. I created a new array of those elements (…
How to escape double and single quotes in a JSON array
I’m trying to create a chat system where every time someone sends a message it gets added to the JSON array in my database for that specific person, but the issue I’m coming across is when anyone tries to use double quotes ” ” or a single quote ‘ in their message. Anytime a messa…
Put a Video player (expo-av) under an Image in React-Native
I’m currently learning React/React-Native using Expo, so I need to play a video this video is going to be saved in a server, but for now I’m testing the video playback locally with a random video and that video need to have a sticker kinda like instagram. I obviously think of merge the two things …
Getting the client request domain from Lambda@Edge function
I’m trying do something like below for HTTP 301 redirect, so that web users will redirect to different news pages. However, seems like this request.origin.domainName == “mydomain.com” part is not working in my function. Is this correct way to pick the domain name which client coming from? I …
How to get last Firestore ID document
i need help with Firestore. I have a database with a collection of Clients that have some documents named by ID (1, 2, 3..) I want a function that count the number of documents of the collection and create a new document with the value+1 (eg: the last document was 6 and i want a new document 7). This is
How can I generate FormControls dynamically inside a FormGroup?
I am receiving an object from the db that contains a few elements with the following format: To work with those “dias” array and include inputs to modify each value in case the user wants to, I’ve manually created a FormGroup containing a formControl for each of those days (the real object c…
convert react virtualized table from javascript to typescript – type issues
I am using this demo: https://codesandbox.io/s/react-virtualized-table-checbox-stackoverflow-rbl0v?fontsize=14&hidenavigation=1&theme=dark&file=/src/App.js And I put into my react project, and I am have problems with this piece of code: The variable newList has a weird type (see error below) and w…
Javascript code not running in order while getting data from database
I have two functions as shown below. It is essentially just getting data from a database. Currently when I run the code, within the console it prints the following: However, I need it to print Successfully got data from table before it prints abc. I know I have to possibly use async within the function howeve…