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

How to reuse SignalR v2.2 connections within an asp.net session

I am using javascript to create a SignalR connection on page load in my MasterPage. Unfortunately, whenever changing pages the connection is closed and a new connection is established.I would now like...

View Article


Setting draft value of rich text area with javascript (Trix/ActiveText)

I have a 'save draft' button which successfully saves message content as a draft. When the page loads with a draft, I add the following script to the HTML:<% if @draft_msg.present? %>...

View Article


Can current window gets moved or resized?

I am somehow familiar with javascript and I am trying to learn all the properties and methods of window, document etc objects.My question is related with methods like resizeBy,resizeTo,moveTo,moveBy.I...

View Article

How to use React components in Angular 8+? [closed]

I'm new to Angular and I'm working on an application made in Angular 8.1.3 and an application in React where there are some .js components made in jsx.I need to export some of these components made in...

View Article

How do I find all possible permutations for a specific number?

I'm trying to get something to work like this: function permutations(sumWorkingFor, [numbersAllowed, numbersAllowed]) {} e.g for permutations(5, [1,2]) it would give:1, 1, 1, 1, 1 1, 1, 1, 2 1, 1, 2, 1...

View Article


How to get the colours I want with Leaflet.AwesomeMarkers?

I'm trying to have the icon colour using awesome markers change depending on individual properties within each marker details, however they all are red instead of some being red and some being green.Is...

View Article

Keep Accordion Sub-menu Open on Page Change in Custom WordPress Theme

I have a client site that requires the side menu to act like an accordion with the sub-menu's dropping down after the parent is clicked and staying open while the parent or any of the sub-menu's is...

View Article

PHP Form same page Submission message

I'm new to PHP and using the following code (which is working) but the page gets changed to another page, the website has different forms and I want the success message to appear on the form or any...

View Article


Testing a catch in a Promise then in jest

I have a function that has a catch at the end of it. The function returns promises and so far all the resolves are working but when I try to test the catch using a Promise.reject( in jest I get the...

View Article


Problem with validations on update instance with sequealize

I am trying check validations my instance on update with sequalize. Like documentation said Validations are automatically run on create, update and save. You can also call validate() to manually...

View Article

How to implement a class controller option in Flare React package

So I don't quite understand how classes work in React, I am new to react and have used useState a little bit, but never have know what to do with a class. I am using this react package that has an...

View Article

Using Variable in a path Javascript

const dispatcher = connection.playFile('C:/Users/Discord/Desktop/${myArray[Math.floor(Math.random() * 10)]}');I need the string in the connection.playFile function to be able to take a value from an...

View Article

Code Explanation: The code returns the word with the most repeated letters,...

Can you please explain to me how this code searches for the word with the greatest number of repeated letters in a sentence? and what each line is doing? if you have other code suggestions in other...

View Article


Image may be NSFW.
Clik here to view.

Can't change text of paragraph with javascript [closed]

Why i can't change text in paragraph?

View Article

vanilla JS hover over div change background color

I'm working on building an interactive grid that is similar to an Etch-a-Sketch. I have my grid set up and am now trying to set up a “hover” effect so that the grid divs change color when your mouse...

View Article


Image may be NSFW.
Clik here to view.

How to delete an item from state in React

I am trying to delete items from my MERN stack app using fetch and I have successfully deleted the item in the database. However, I cannot figure out how to delete the item from state when I click the...

View Article

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...

View Article


Image may be NSFW.
Clik here to view.

Issues with using nightwatch slack reporter

I'm trying to set up my nightwatchjs tests to report to Slack, using the nightwatch-slack-reporter nodejs package.When I run my nightwatchjs test from the command line, using the following;npm run...

View Article

Object property it's overriding all grid when updated [duplicate]

Making a battleship project in JS for practicing OOP, and I'm having a hard time with the function of positioning objects (ships) properly in the grid boardI have this factories:const Coordinate =...

View Article

How to add javascript file to custom form and pass the data to the js file

I'm working with Drupal 8 and I have custom ajax form it works fine when I test it using [Ajax htmlCommands]. but now I want to send the data to the javascript file to show it in a div and do some...

View Article
Browsing all 138134 articles
Browse latest View live


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