Questions tagged [javascript]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). This tag is rarely used alone but is most often associated with the tags [node.js], [jquery],[json], and [html].

Filter by
Sorted by
Tagged with
0
votes
0answers
5 views

Hiding the dashed lines on google maps?

Is it possible to hide the dashed lines that I've pasted in this screenshot with Javascript? https://www.awesomescreenshot.com/image/5114158/80a4133b7cd17f8440a7d5cb5ffdf091
0
votes
0answers
5 views

Auto progressing and animating slider

I'm attempting to build upon a simple slider but I'm having a couple of issues. The slider works when the arrows are pressed but whenever I remove any of the dots variables that aren't needed the ...
0
votes
0answers
6 views

How i can do a nickname reseter to your original nickname example !reset and resets your nickname

I have this, but i dont know how to reset nicknames if (message.content.startsWith(prefix)) return; switch (command) { case 'reset': };
0
votes
0answers
6 views

Dynamic Progress Tracker

I have a client that wants me to create a react component of a dynamic progress tracker in the shape of an iceberg (image attached). They want it divided into 9 sections: 2 above "water" and ...
0
votes
0answers
8 views

How to save toggle switch in Chrome Extension

I am trying to create a Chrome extension which shows notifications after every hour. To receive notifications you must toggle a switch from the popup menu, however, right now once I toggle the switch ...
-1
votes
0answers
9 views

Discord.js i dont know ho to create Random Answers

I'm new to programming and I want to know how to create a bot when you write !Random he answers I'm thinking and after 2 minutes he answers with a random response between Hello, Hi, Welcome. Thanks to ...
1
vote
1answer
16 views

How do I add and remove classes to multiple child elements nested in an UL with a single click using Javascript?

I want to start by apologizing for such a long question, I just hope I wont make it difficult to understand as a result. I have created a side bar with three Menu elements in an UL which expand to ...
0
votes
0answers
8 views

force directed pie chart labels errorUncaught TypeError: Cannot read property 'length' of undefined

I am developing an data visualization using force directed graph and pie-chart in D3.js. I have a use-case where I have to display pie-chart on a specific type node. I was successfully to do so. below ...
1
vote
1answer
8 views

listout all the files of a folder to the right side of a container using vuejs

In my application, i have list of folders and each containing some files. I have to display those files while choosing particular folder. Those folder will be in left side.While selecting that folder, ...
0
votes
0answers
6 views

When getting user video stream my webcam powers on but the video stream doesn't show

I am following this tutorial on face-api.js: https://www.youtube.com/watch?v=CVClHLwv-4I But when I start the code my webcam says it's working but it doesn't display in the browser. When I inspect it ...
-1
votes
0answers
22 views

auto add like for users

i want add user like to post on page load i.e i want to make the like botton show liked if user already liked the post but it not working this is my ajax code for (var l = 0; l < 5; l++) { ...
1
vote
1answer
41 views

Why is getDate() a month off?

I'm trying to iterate over objects that have a date within a specific time frame. These time frames are days in the past week bounded by startDate and endDate. I have a for loop that sets the ...
0
votes
0answers
5 views

Mongo Error: can't convert from BSON type objectId to String

Good friends, I'm working on a messaging service and I need to group the messages by conversation and show the last one to incorporate it in a list of conversations. I was guided by another ...
0
votes
0answers
14 views

array of object saving last index value in all indexes

This is the struct var player = { ID: "", Name: "", Country: "", Scores: [] }; This the function that uses the struct function getNewPlayersData(sheetnew){ //new ...
0
votes
0answers
9 views

Not able to retrieve data from firebase firestore

I am saving data to firebase successfully const productsRef = db.collection("store").doc(userID).collection("products"); productsRef .doc(productID) .set({ ...
0
votes
2answers
27 views

Can anyone fix my js textarea restrict special characters space issue

Original code <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-...
0
votes
0answers
7 views

Electron app does not display changed css unless I manually refresh after message is sent through socket

My problem is I have set up some websockets to communicate data through and when the client receives the data it will change the css of the webpage app. The issue is the data gets sent but the ...
0
votes
0answers
17 views

how can I modify this javascript code for WebSocket functionality

I used following code without error: "use strict"; var ws = new WebSocket("wss://testnet.bitmex.com/realtime?subscribe=trade:XBTUSD"); ws.onmessage = function(e) {document....
0
votes
1answer
18 views

api call reloads and refreshes the entire page instead of just updating the div

I have this code here. <div class="page" id="content-apiservicedemo"> <div class="container"> <hr> <p&...
0
votes
2answers
31 views

Javascript onclick calls wrong function [duplicate]

I'm trying to write some Javascript so that when a button is clicked it creates a button with a onClick attribute. Here is the HTML: <button id = 'click'>Click</button> <div id = '...
0
votes
0answers
11 views

VueJS: Fixing component order in Bootstrap

I've been having some trouble recently with the order of Vue components in Bootstrap. I'm trying to generate some Bootstrap collapsible content in Vue here's the code so far: HTML <div class="...
0
votes
0answers
13 views

How to make a div snap to the side of the tab under a certain width?

I'm making a 'news page'-like webpage, and it works perfectly on a 16:9 display, it does actually struggle with smaller width tabs. There are 3 solutions I want to test. Making the margin that holds ...
0
votes
0answers
7 views

integrating shiny to another web page

I have created a web page using R packages in Shiny web application and have published it to shiny.io. What can I do to include this page to be a sub-page of another website and make some possible ...
0
votes
2answers
35 views

Compare 2 array key and values in the same object

I am currently working on an app using Firebase (Realtime Database) and ReactJS. I have the following : I'd like to check in sellersList for values that are true. For each value that is true, i'd ...
0
votes
1answer
14 views

How to add open questions with textbox form Javascript

I am looking to change the following code that I have found and to add questions with textbook or box that the user can fill in the answer in stead of only multiple choice. How ever, every time I am ...
2
votes
1answer
33 views

How to print items within an array sequentially

I'm learning Node and I'm attempting to create a readme generator. I've created my prompts to confirm if the user would like to add gifs/images to their markdown. I've made it so that if the user ...
1
vote
3answers
28 views

VueJS = Uncaught TypeError: Cannot read property '' of undefined

I have a basic input that should update a data on input change, but it doesn't because it returns Uncaught TypeError: Cannot read property 'settings' of undefined Vue component <template> <...
-1
votes
0answers
15 views

PDF embed with ReactJS

I'm working on a web application created with ReactJS. I want to incorporate a PDF viewer like the one in the image. How could I do this. Specifically, how can I extract data from a pdf file in order ...
0
votes
1answer
15 views

Using Vue.js directives within component template

I'm new to Vue.js and trying to create a component that connects to one object within some global-scope data and displays differently based on the specifics of each object. I think I'm ...
-1
votes
2answers
30 views

How can I order integer string, floating number and with special characters

Please help, i new in javascript thx.  let test = [" 1/2", " 3/4", " 1", " 1.1/4", " 1.1/2", " 2", " 2.1/2", " 3", "...
-1
votes
0answers
25 views

Cannot read property 'roles' of undefined (discord.js)

So I wanted to create an unmute command for a discord bot, the command would work great except for me being strict and wanting to let people know if the role was already removed by somebody.I have ...
2
votes
1answer
16 views

Three.js: Move camera to a point on the surface of a sphere and make the camera look along the surface

In my project I use https://github.com/vasturiano/react-globe.gl to render a 3D globe. The globe is a sphere where: radius = 100 position = (0, 0, 0) The camera uses OrbitControls with: ...
1
vote
0answers
9 views

Please How can I send my login form data to my email address with sketchware

I created a sketchware app with form and login. So I want to send my login form to my mail and am having issues with that. Ive tried using the intent function and I dont know how to use the firebase ...
1
vote
0answers
19 views

Passing a complex model to controller using AJAX in ASP.NET Core MVC

I'm trying to pass the model from the view to controller using AJAX, the AJAX call works with a hard-coded JSON string but fails with the actual JSON and I don't know why, any help is very appreciated....
1
vote
0answers
12 views

Video capture in mobile browser at 60 FPS

I am trying to capture video at 60 FPS from a web app in Chrome Android. I have the appropriate video.frameRate constraint set for the call to getUserMedia. Chrome recognizes the frameRate setting ...
-5
votes
2answers
25 views

Type Error: Cannot read property 'includes' of undefined [closed]

This works console.log(comments[i].includes("NEW ENTRY")); This doesn't work while ((comments[i].includes("NEW ENTRY")) == false) { //Some code }
1
vote
1answer
25 views

How to get onClick in React to work on a single element with multiple siblings?

I am new to React and have a problem with trying to fire an onClick event. I have the event working, when it gets clicked, the div appears and reappears. The problem that is that if I press a button ...
0
votes
2answers
31 views

How do I get the event listener to change my css background color using javascript?

I would like to be able to change the background color of the list item. When I remove the if-statement and just set the background color, it works. However it fails with the if-statement. I don't ...
0
votes
0answers
8 views

How to add event handlers on each buttons incrementally on JavaScript?

I have created cart items that has set of buttons (-) (+) on each item. How can I add EventHandlers on each set of buttons? My buttons are incremented inside my javaScript (innerHTML) so that cart ...
-4
votes
1answer
42 views

If I can't use return to exit a for…in loop, what can I use?

What's the rule with return in for...in loops? Checked MDN MDN for any references and found none. It looks to me like it isn't allowed in for...in loops and the loop won't run: o = { color: "...
0
votes
0answers
14 views

React Native - Nesting BottomTabNavigator inside StackNavigator - React Navigation v5

This is my first React Native project, I'm using react-navigation v5 and I can't make it work with nesting navigators. My routes: Stack.Navigator * Home (Tab.Navigator) - Travel (Screen) - ...
0
votes
1answer
11 views

Error: mobx-react-lite requires React with Hooks support

I cannot launch my application. I have no clue what I am searching for. Everything seems good. In the very beginning, I tried to change my store from redux to mobx. Everything I've done is mostly ...
0
votes
2answers
11 views

Firestore: How can I use a transaction to read and then write to a document that I don't have a reference to?

I have a document which i fetch with a query like this: var myPromise = db.collection("games").where("started", "==", false).orderBy("created").limit(1).get() ...
-2
votes
1answer
18 views

I want to access a javascript variable in my HTML in my main node js file [duplicate]

function takePic(){ var dataURL = canvas.toDataURL(); } So i have this function in a script tag nested in my HTML. I have a separate js file to start the server. My problem is I want to use ...
0
votes
0answers
6 views

Stripe integeration with rails 6

I have my signup functioanlity using devise and extended devise registration using nested attributes i.e I nested attributes of Payment's class into user's class. My payment.rb class Payment < ...
0
votes
0answers
17 views

MixItUp event listener not picking up changes to checkboxes set using .prop('checked', true).trigger('change');

I'm setting a series of checkboxes and radio buttons from one form (Form A) to another form (Form B). And using the fields in Form B to filter out a bunch of content using MixItUp.js . The fields are ...
0
votes
1answer
29 views

2 useState's inside a useEffect one works , other does not even though they are almost the same

I've got this useEffect function set up to run just once when the page renders. Inside it I am using two useState functions : setPageLenght and setPages They are defined as follows const [pages,...
0
votes
2answers
26 views

Why doesn't this function work in Safari? (works fine in Chrome)

I have a simple function that calculates the number of days between 2 picked dates. Can anyone help me explain why it is only currently working in Chrome, it does not currently work in Safari. The ...
-2
votes
0answers
24 views

reset var to original jquery

this is the dead script for my shooter game (the buttons are just for testing) but i want to reset the hp to 100 when the player uses a med kit. is there like a reset() command or something? this is ...
0
votes
0answers
17 views

(JS) Generate list of all possible usernames with requirements

I own https://cobaltstats.com, which is a game tracker website. Currently, it caches all stats and refreshes them every so often. However, if someone looks someone else up and that user hasn't been ...

1
2 3 4 5
41210