Category "javascript"

Angular not passing object to html page

I am having issues with learning angular, I didn't use to have these problems before, but now when I do these demos things work great until I switch from using

Angular - Async pipe in ngIf and text binding will not display first emitted value

I have very simple component template: <button (click)="emitNextValue()">Next Value</button> <p *ngIf="text$ | async"> {{ text$ | async }}

Parsing Javascript cookie values and separating values

I'm still learning Javascript and I'm trying to parse a value from a cookie in a specific key: I'm using this current line: const cookieObj = new URLSearchParam

Mixing functions and const/let inside conditional statements cause ReferenceError in Safari

We have something like this if(true) { const a = 1; function myFunc() { alert(a); } myFunc(); } In Safari 11 this cause "ReferenceErro

Chrome browser can not read source map its from Express socket.io

My problem is : DevTools failed to load source map: Could not load content for chrome-extension://flijfnhifgdcbhglkneplegafminjnhn/content/socket.io.js.map: Sys

useContext gives App.js:24 Uncaught TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))

I am using an Auth Context Provider in my App, which is initialised in this file: authState.js import React, { useReducer, createContext, useContext } from "rea

how to add a new item inside an object

react I have that problem. I cant add a new item inside an object const person = { name:"farhan", age:"25", address:"daka" }; person.push({professi

Want to run js in loop [closed]

var pause = document.querySelector(".pause1"); var audio = document.querySelector(".audio1"); function togglePlay() { if (audio.paused)

Parsley + recaptcha v3 promise

I'm not able to get the following code to work: $(function() { function verifyRecaptcha() { return new Promise((resolve, reject) => {

react merging two components and sorting data by date and time (newest at top oldest and bottom)

I have codes below code removed The problem is it prints rows of expenses and then rows of incomes (i.e posts from expenses are printed first then after them i

swapping array elements without a temporary variable

The following code: var words = ['javascript', 'hmtl', 'css', 'python']; words[0] = words[3]; words[3] = words[0]; alert(words); ...gives

How to recognize Id attribute in rails form_tag?

I am using a form in rails to pass an id. That id will trigger the javascript Sweet Alert function which will pop up a modal with a confirmation message. When t

Why am I getting .slice is not a function? [closed]

I know that .slice() can only work on arrays and strings. I'm calling .slice() on an array and I am still getting that error. Here is my code:

set knockout.js value programatically from "outside"

I am brand new to knockout.js - I have taken over an existing app written in it, the previous maintainers having left - and I want to start by writing tests tha

send "&" in url angular

I'm using the Angular version 12 I want to send the following object in query params: { dynamicQueryOperators: 6&dynamicQueryOperators=8 } But in the end

Uncaught ReferenceError. Firebase SDK not recognised despite correct order of script tags

I am trying to implement firebase authentication on my website. However, whenever I try to test the function, I get the following error: Uncaught ReferenceError

I'm having trouble understanding how to get JavaScript to function as a program

This is going to sound really, really basic, but I just need a little help understanding one of the concepts I'm struggling with in Javascript. I have been read

Draw layers when drag map Openlayers

I have a map in openlayers 6 with some vectorLayer type layers drawn above, the problem is that when I drag the map the part of the layer that was not visible i

DOMException: Failed to load because no supported source was found in html file

im getting DOMException: Failed to load because no supported source was found in audio.play(). im getting his issue on audioElement.src = 'songs/${index+1}.mp

Uncaught (in promise) SyntaxError: Unexpected token in JSON at position 0 And 504 connection error to ipfs

I am trying to render NFTs I've created and am getting a 504 (timeout) error. This is very strange because it was working a while ago and I didn't actually chan