Collect all kinds of javascript programming exceptions and fault solutions.

Gatsby: React conditional rendering based on window.innerWidth misbehaving

Conditional rendering of components based on window.innerWidth seems to not work as intended just in the production build of Gatsby based website.
The hook I am using to check the viewport's width,

I want to check if my id or class exists in a table | JavaScript

I have 2 tables, one with select option and one with results. When I choose one name from select, I show me some images from results. I do when I click specifically one name from select, change css

Adding text into a double mustache using Vue.js

I'm new to Vue and trying to learn. I have an object:
info: [
email: ""
}, {
Initial: "Initial Biosketch"
How do I load values into the html? I have tried {{

How to change value of one table data tag with one button press

This is my JS code, what I'm trying to do is click the button with the id="tg-13", just display a 13 in the td. But what really happens when I click the "tg-13" button, all the numbers appear. How ...

Can't find html element with jquery id selector when using variable as parameter to the jquery function to find it

Jquery can't find html element via ID selector when the ID is provided via a variable.
When I provide the id directly then it can find the corresponding html element. (See example)
replicated it ...

Cannot find record using MongoJs

I have a login system connected to mongodatabase but the result is always 0 even if i'm searching for a record I know.
thePass = passWord.value
theUser = userName.value
loginButton.onclick = func...

how to dynamically change the id of a html link with php?

I have links which is on one page and and I sent the links to the database and then on another page I am retrieving the links from the database. I can only send four links to the database, I made i...

No matter which link I press the "x" variable always saves the value "A"

var Words = ["GREEN", "LOVE", "HOPE", "JOYOUS"];
var Letter = "";
var z;
var x;
function LetterPressed() {
x = document.getElementById("LettersInTheTable").text;

Why can't React project name contain capital letters?

I got the following message while trying to create a new project "newRecipeApp" in React.
npx: installed 91 in 29.359s
Could not create a project called "newRecipeApp" because of npm naming restri...

How can i use/ call maps api in my search box using javascript code to show list of cities

i m trying to use Rapiapi in my webapplication and trying to use the javascript code to get the name of cities and country by autocomplete but im getting error when i try to search. will anyone be ...

Tensorflow model not training in javascript

TensorFlow.js version
I am trying to train a model in javascript and the model fails to learn or converge. I took the same model and the same data, which I used in the python

Computer Guess A Number JavaScript

I am trying to create a simple "guess the number game" in a web page where a user is the one thinking of the number and the computer is to guess the number(in range 1-100) that the user is thinking...

How to make multiple read more read less buttons in the same one page

What am I doing wrong here? I put each one into a separate ID however it still isn't working on my code. Please help it's for an assignment due in a few days!

function readMoreRome() { //finds

How to connect Node Js server with Android Studio app?

I'm trying to establish connection between an android studio and a node js server, but I'm kinda stuck. I pretty sure I've done many things wrong, but my one error message I can start searching for

"The keyword 'interface' is reserved" when using LernaJS

Can not seem to run NextJs in development (next dev) when using Lerna. I can get other files to pull in just fine (e.g images) but it doens't seem to process TS on the fly using this method. Anybod...

How do I render results after I make an ajax call?

I am creating a tinder clone for fun and learning and am trying to render the matches for a person. This is my first day with react native so please excuse my learning. I make an API call:

How to use optional chaining with array in Typescript?

I'm trying to use optional chaining with array instead of object but not sure how to do that:
Here's what I'm trying to do myArray.filter(x => x.testKey === myTestKey)?[0].
But it's giving error

JS : switch to funtion with dropdown binding

Hello i want to use tinymce and mathlatex in form with select option field where i can select math or text i tried to use this code :
var opt = $(this).val()...

"zoid destroyed all error" from paypal integration with ruby on rails

I'm getting an error that says zoid destroyed all when the paypal buttons try to load on my ruby-on-rails project. When I initially load the project directly to the payment page the buttons work but

JS How to test if a string is only an abbreviation?

Any JS Regex expert that could help me return true if the word is only an abbreviation or else false?
Tried this regex.
But it also returns true for strings like.

Find objects by id using arrays in js

In my code, I have an 8x8 table with each <td> having an id of two numbers ranging from 0-7 (i.e. "0, 0", "2, 5", etc). What I need is to make a function that when I click on a <td> it ...

Laravel 6 css and js files not found ( net::ERR_ABORTED 404 (Not Found) )

When I use Laravel development server (php artisan serve) all is working but when I want to use xampp server I get error 404 in laravel auth login and register pages
I use href="{{ asset('css/app...

How to implement video calls over Django Channels?

I would like to create an app that enables users to make video calls.
I found some insight here, but unfortunately, the answer doesn't explain neither what third party services can be used, nor any

JavaScript gallery to close (instead of loop), when gallery end/beginning is reached

Plase see title. I would like to achieve the following:
1. On Mobile: In PhotoSwipe, when a swipe to view next image is detected (when already viewing last image), Close PhotoSwipe.
2. On Mobile:...

Find edge case in palindrome logic

I was brushing up my coding skills on CodeSignal. Initially I came up with approach1 which passes 26 out of 30 test cases, I can't see input for those failed test cases as those are hidden. Then re...

Flexbox generator does not display well in my react application

I am testing and have created that template:
import React, {Component} from 'react';
import {View} from 'react-native';
export default class MyLayout extends Comp...

v-model get [object object] at filter

I'm filtering two arrays of objects because I want to show only the members which aren't added to a list.
I have:
this.members which means all the members added to the list
this.users_masks which m...

execCommand() is now obsolete, what's the alternative?

I intended to use Document.execCommand() method along with contenteditable attribute to build my custom WYSIWYG editor. But when I checked the documentation for Document.execCommand(), I found that...

Cannot upload a large file through HTML form in an appscript webapp

I cannot upload a file,which has a size of 177 MB into google drive through an HTML form using appscript.It doesn't show up any errors.But the browser uploading status is 0%.
I am using the follow...

Ionic 5 page div in ion-contents not scrolling on iphone

My app has a div element which holds an ion-slides item.
ion-slides has a number of ion-slide that slides horizontally. Below is my code
<ion-content [scrollEvents]="true">
<div *

How to print dd-mm-yyyy at url in Kantu (UI.Vision)?

I am using Kantu (now known by a new name, a browser extension to do things on websites automatically, based on Selenium (I assume so).
I want it to print dd-mm-yyyy at the website's ur...

Discord bot crashing after trying to play link(Node.js)

I am trying to make my bot work, yet again.
This is my play function.
function play(connection, message) {
var server = servers[];
server.dispatcher = connection.pla...

Response and Error handling in Google Apps Scripts. doPost? withFailureHandler()?

I hope everyone is safe and healthy given the current situation.
I have a question in regards to a project with google apps script. I have a web app and I have been able to figure out routing with...

Google Apps Script html not working, script not launched

I really hope you can help me with this!
I do not understand why my html 'script' does not want to communicate with my 'code' as it was happening before.
This is the story.
I have built a little

Add javascript selector

I would like to add html, css code to the wordpress homepage using javascript.
The problem that there is no id or different css class on the objects that I would like to change (I would like to add...

I started to learn javascript. How can I add another scroll function?

This is HTML-code:

<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">

Tracking validated submissions using GTM on Mailchimp Embedded Form

I'm using GTM to track submissions to an embedded Mailchimp form. Relevant post here: Tracking submissions on MailChimp embedded form
Per the original post answer, I am able to use this code to tr...

Toggle between divs in React JSX

So I've got two input boxes that I want to be able to toggle (hide) between by clicking on them. They populate a table below them. I know it's not difficult but can't seem to make it happen easily....

Get content from div with HTML Agility pack with C#

I am using the parser HTML Agility Pack in a project. I am using the PubNub chat script. I want my C # program to take the chat messages and print them on a label through the div id = "box".

How to execute function only in browser environment

Please, I am new to SSR and Nextjs apps. I am using useLocalStorage Hook in order to save user data to local storage. Every thing is working fine but in my terminal ( node js ) I get message window...

The second modal with a different ID opens with a different effect - Why?

I've got two different pricing cards:
<div class="card card1" id="open">
<span class=title>Basic</span>
<h1>$99 USD</h1>
<h4>Lorem ipsum d...

In Node Js, how can I write to file chunks uploaded from a video

What I'm trying to do is upload a webcam or audio stream to Nodejs and save it to disk. The goal is to send the data chunks to the server as soon as the data becomes available. I've grabbed the str...

How to implement initial sorting in SAP UI5 Smart Table

I have a smart table, with some custom columns inside it. I would like to sort the table initially based on a certain field, how do I achieve it?
Till now I have tried the following, but it didn't...

ReduxForm Field component not working with ReactTable Cell property in column Headers

In ReactTable, I want to render my own Checkbox component using Field from redux-form through the Cell renderer of react-table.
But I'm getting a getting this error:
Uncaught Error: Maximum update

Why this invert conditional animation does not work?

This piece of code is supposed to expand the #bottombar when #topbar is clicked and hide it while the #bottombar height is 200px, but acts strangely. Why is that?
<!DOCTYPE html>

How to prevent mixed data between respondents from Google Web App forms in Spreadsheet?

I am new to Google Web App to Spreadsheet integration and I wanted to write a data from my Google Web App forms to Spreadsheet instantly. Because when I try to submit my Web App forms at the same t...

how to trigger CSS over a button

I need the button as a trigger for a CSS animation. It is just something basic but I messed it up. What is my mistake? Why did nothing happen when I pressed the button?

function xyz() {

Websocket server and npm start on localhost

Out of boredom I currently try to create a simple chat-app on my localhost.
To start this all out, I began with a plain react app based on create-react-app.
In there I have the following code to s...

Barba wrapper not found

I'm trying to do page transitions with barba.js, I used the data-barba="wrapper" and data-barba="container" exactly like in the documentary.
Here's a shorten code of the html:
<body class="page...

Micro Front Ends - Approach

I have an old legacy app built in AngularJS (Angular 1), making framework changes or any other major changes is not feasible at this point.
There is new app built using newer stack and its standal...