Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

Questions tagged [javascript]

JavaScript (not to be confused with Java) is a high-level, dynamic, multi-paradigm, object-oriented, prototype-based, weakly-typed, and interpreted language used for both client-side and server-side scripting. Its primary use is in the rendering and manipulation of web pages. Use this tag for questions regarding ECMAScript and its various dialects/implementations (excluding ActionScript and Google-Apps-Script).

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

Create a Preloader

Hi Guys, I want to create a preloader like the image. Do you know a free source code for it? Any help will be greatly appreciated. Thanks!
0
votes
0answers
6 views

chartjs rotate label into slice chart pie

Can someone help me rotate the text inside the slice? I need it to be like this chartjs pie slide text rotate [https://jsfiddle.net/sgargeta/zo4ypr8k/2/]
0
votes
0answers
8 views

How to send an object using formData.append through JSON

I have an object and I tried appending the names and values from that object to formData Object but I am trying to send it to my php file using JSON and I don't think I am doing it correctly. Either ...
0
votes
0answers
15 views

Removing object array from array based on condition

I have array of json as follow and i need to filter based on following conditions eg: Filter and get result "Attribute1" which contains "sad" eg: Filter and get result "SubAttribute1" of "Attribute2"...
0
votes
0answers
9 views

How to check if clients browser language is en-US, en-EG, en-AU, en-GB, en-CA then I want to show en file as my localization?

I have list of languages in array as shown below; I currently only have english js file which is used for localization depending on browser language. // import en from './locale/en'; const ...
0
votes
0answers
5 views

how to display .c4d file in google picker?

Is there a way to display all file types in google picker! enter image description here enter image description here
0
votes
0answers
6 views

Combine RXJS observables, but wait for first one to begin emitting values

I have a stream of video player events that fire as certain events (like pause or play) is pressed.The stream is coming from two observables using combineLatest, to grab the current video position ...
0
votes
0answers
7 views

JS: Template literal is not accepting XML

When XML is defined as a template literal it is not being recognized. For example, this: <?xml version="1.0" encoding="UTF-8"?> In the script below, testvar1 (a string) is rendered, but not ...
1
vote
2answers
16 views

FadeIn new background image Jquery

I have a div with a background image defined: #section0{ background-image: url("?/questions/tagged/javascript/images/top_back2.jpg"); } I have a setTimeout function changing the background image to something else 3s ...
0
votes
0answers
7 views

What the query in mongodb for filter, get data on nested array, and pagination based on nested array

i have a problem here, i need to filter, get data from nested array, and paginate the data based on nested array (child property with array) in the mongodb data my data is embeded document like this ...
0
votes
0answers
6 views

before forward slash `/` Any X amount character I want to wrap inside the div/span tag

I am a beginner on jQuery. So I need help from your side. I want to write a jquery/javascript function. before forward slash / Any X amount character I want to wrap inside the div/span tag. Can you ...
3
votes
5answers
43 views

How 'aaa'['toUpperCase'].apply('abc') works? [on hold]

I'm a beginner of JavaScript. I am really curious about how the code works..!! Does anyone could explain how the code down below works, please? It seems different from just 'abc'.toUpperCase(); '...
0
votes
1answer
6 views

Why does navigator.mediaDevices work differently in localhost and server?

I'm currently working on a video chatting project. And it uses navigator.mediaDevies. It works OK and returns MediaDevices object in localhost, but when I deployed my project to a server, it returns ...
0
votes
0answers
5 views

How can i make pairing or bonding by using Webbluetooth API?

Actually, it's possible to target a unprotected characteristic and start notification. write or read info on current charateristic. Can someone , please confirm it's possible to use promise on ...
1
vote
0answers
11 views

Externally loaded script is not getting invoked in React app

I am using a custom interactive icon from nucleoapp.com. I followed the instructions in this stackoverflow answer to take the corresponding script and load it asynchronously and access it on load: ...
1
vote
1answer
23 views

Parameter result implicitly has any type

I have a chat app where I'm trying to send notifications for all of the subscribers. I have to iterate through the users to use the ID's in the where clause to grab their device tokens import * ...
0
votes
0answers
11 views

On scroll event, automatically scroll to bottom of element

I have a banner on the top of my page that is 700px in height. I'm trying to make it so that when a user scrolls downwards when the banner is in the viewport it overrides the default scroll ...
-2
votes
0answers
29 views

How to merge 3 array using javascript

need help on how can I join these 3 set of arrays in Javascript. TIA var array1 = [5,6]; var array2 = ['x','y']; var array3 = [['a','b','c'],['d','e','f']]; expected result [5, 'x', 'a'] ['', '', '...
-2
votes
0answers
10 views

Page turn for dynamic contents

I am looking to find a way to implement a page turn like Pocket. I have a look at turnjs but it doesn't suite me since the content of the page is depend on the size of the device or the size of text. ...
0
votes
0answers
20 views

is it possible automatically download a file by the link in javascript?

lets say i have 1000 link like https://test123.sharepoint.com/teams/TechnicalRecordsManagement/Workshop/2014/578090.pdf is it possible to make automatic download without user interaction due to ...
1
vote
2answers
38 views

Show tooltip using JavaScript

I am trying to show a tooltip by hovering the mouse on a circle inside a canvas. While the CSS is changing from hidden to visible by javaScript (saw that through chrome inspect), the tooltip is not ...
0
votes
0answers
11 views

Angular/TS/JS Deep update of an existing (generic/any) object with property values of another object

I am hoping to create a generic function for an update of any object by another object. We will assume that we have two objects objA and objB. objA - the object being updated; objB - the updating ...
0
votes
0answers
8 views

javascript i tried to create a box dropping game but the speed of the box dropping down is to even when i tried regulating the settimout

the boxes are moving in a absurd and very fast manner i tried reducing the set timeout out and the direction of the boxes function gameInit() { var redNode = document.createElement("div"); redNode = ...
0
votes
2answers
15 views

making javascript push menu scrollable (no scrollbar)

I've got a push menu (left to right) that slides out from the left of the page sliding the page to the right. I'm trying to add a safeguard to it to where if the links exceed the page height, the ...
0
votes
2answers
18 views

How to create methods that run firstly before going to other methods in vuejs?

i'm creating CRUD app with vuejs and axios for ajax. i also make a login before doing CRUD, but i want validate a user before doing CRUD in this case i'm using vuejs only for rendering data to html ...
0
votes
1answer
16 views

why i have NaN on Node.js?

module.exports = { HTML:function(title, board, control, page){ return ` <!DOCTYPE html> <html> <head> <title>$</...
0
votes
0answers
10 views

Discord Bot Javascript create a cooldown for command

I am making an economy section for my bot and one of the more requested features is a work command. However, I dont want users to be able to constantly work and would like a delay of an hour between ...
1
vote
0answers
13 views

How do i send a google slide as an attachment in my email using google-appscripts?

I'm trying to send a google slide as an attachment/image in my automated email using google appscripts but i can only send images. I change the slide info everyday so I need it to display the new info ...
0
votes
0answers
24 views

Using jQuery to open and close Bootstrap drodown

I wang to open and close the Bootstrap drop down menu use Jquery. My code for Dropdown: <li class="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="...
0
votes
0answers
10 views

Protractor test - Failed: javascript error: [$injector:modulerr]

I am trying to execute protractor test but without success. I get below error message. Any idea why I am getting this error? I have installed nodejs, npm and protractor correctly. C:\...
0
votes
0answers
15 views

ReferenceError: exports is not defined

I'm running tests using karma and one dependency of my project has a dependency on es-cookie and it seems to be giving me problems when running the tests. I tried adding a commonjs preprocessor but ...
-1
votes
0answers
15 views

why does a web page nullify window.alert

I was looking through the source code of a website (an online game) when I saw this in the html <script> window.alert = null </script> I have no idea what the reason for this is. does ...
-1
votes
0answers
16 views

Multiple calculations in html / javascript code - text box data entry

I have asked this question before but have had to clean it up, difficult to follow, cause it was a mess, so its down to the bone now, in the format below the code works, the issue I am having is that ...
1
vote
1answer
18 views

Javascript to detect any wildcard url from certain domain (ex: google)

I am writing a simple if else if function. If prevPage contains any of 'accounts.google.com' redirect to homepage, else if not from 'accounts.google.com' redirect to login, as simple as that. I only ...
0
votes
1answer
19 views

Redirect to a different URL on page refresh [duplicate]

I want to send a post request which in turn is going to redirect to a different url when a user clicks the refresh button in the website $(window).on('beforeunload', function(){ console.log(`...
0
votes
1answer
12 views

D3.JS Tree Map Loading in CSV

<!DOCTYPE html> <meta charset="utf-8"> <!-- load D3js --> <script src="https://d3js.org/d3.v3.js"></script> <!-- load D3plus after D3js --> <script src="https:/...
0
votes
0answers
7 views

socketio client reconnecting randomly, generating new request.SIDs

Client connects and receives a request.SID, but after some time it keeps reconnecting randomly and receiving new SIDs. app.py: import json from flask import Flask, render_template, request ...
0
votes
0answers
9 views

Render Google Charts with Puppeteer

I am trying to figure ou the proper way to combine Puppeteer and the GoogleCharts library to render Bar charts and export a PNG image of the chart. The basic layout, mostly inspired by the Puppeteer ...
0
votes
0answers
8 views

Is it possible to check what permissions a webpage has requested after load?

I'm trying to find a way to tell what permissions a loaded page has asked for like geolocation, notifications, camera, microphone, Notification class has a requestPermission() method which I think I ...
2
votes
2answers
41 views

Highlighting A String Based on given indices

Let's say I'm given const s = "Old Man's War" //Each indices represent the beginning and end index of the string const indices = [ [ 0, 0 ], [ 5, 5], [ 11, 11] ] The indices represent ...
0
votes
1answer
17 views

In _.invoke source code, what is the args' role?

I just started to learn JS few months ago and I tried to understand what the "args" doing in "_.invoke" source code. Is there anyone who can answer this, please? I read mdn .apply and read other _....
0
votes
0answers
11 views

Get Full ID from element with token from WebBrowser VB.NET

How can I get the full ID from an element with a token or a numric ID at the end, Something like this but VB.NET didn't seem to handle the querySelector the same way. Javascript getElementById base ...
0
votes
1answer
30 views

Add 1 to each element using .map

I have an array created and I would like to know how to use the .map function to add 1 to each element of the array function range(n){ let arr= [...Array(n).keys()]; }
0
votes
0answers
8 views

console.log(err) and console.trace(err) do not give line number of the function called that ended up throwing an Error

when i was using an external library i was surprised to see that console.log(err) did not output what i thought would be the complete stack trace. in other words, it did not output the part of my code ...
0
votes
1answer
16 views

How to config ignore single line statement in eslint/tslint?

I wanna never using non-block statement. Like, if (pass) continue; // (X) if (pass) { continue; // (O) } Is there options for eslint/tslint?
0
votes
1answer
16 views

How do I write Json path expression for my payload

Here is my payload and I need to extract short_name of country & state $.results[0].address_components[what goes here to extract].short_name The objects are not consistent. { "...
1
vote
1answer
33 views

Deep explanation of the conversion of a simple array into two-dimensional array (matrix) with Javascript

I would like to have a conceptive explanation regarding one of the parts of the function that I will post below. I discovered the following solution for a problem: let argh = [1, 2, 3, 4, 5, 6]; ...
1
vote
1answer
19 views

Vuetify snackbar conditional

Does someone know how display a snackbar depending of the result of answer of server. For example, if submit is ok, display success green snack bar with success message but if I have a error I need ...
0
votes
0answers
9 views

Comparing mutex implementations for async JavaScript

I've found somewhere implementation of the mutex pattern in JavaScript that works well but it looks really complex. Even, though I understand mutex pattern I don't know why promises in some places are ...
-1
votes
1answer
26 views

Is it possible to change the style of an element when a specific div/element is scrolled into view?

Specifically, I want to change colors of sticky and fixed elements on my page dynamically as the user scrolls into specific sections. I know that this is possible with the pixel height on scroll, but ...