Questions tagged [javascript]

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

0
votes
0answers
5 views

How to remove an element from a sorted alphabetic list and still return the list as sorted in C#

Eg: List('A','B','C','D') If I remove 'B' i need the result returned as ('A','B','C') i.e the element 'C' should become new 'B' and 'D' becomes new 'C' and so on. How to achieve this result?
1
vote
1answer
17 views

Show pop up only first time user login in express framework

I'm using express Node.js framework and cookies for authentication. But how can I show pop up for only first time login.
0
votes
0answers
9 views

Currently, our code displays all new tasks at the bottom of the list. That's not very good for a task list,

Sorting our tasks Currently, our code displays all new tasks at the bottom of the list. That's not very good for a task list, because we want to see the newest tasks first. We can solve this by ...
0
votes
0answers
12 views

Google Apps Script array filtering is altering objects in the array

I'm getting a range of cell values and storing them in a multidimensional array, they essentially look like [[true, DateTime, string, ...], ...]. I am attempting to filter on DateTime == today. What ...
0
votes
0answers
11 views

Webscraping HTML page with javascript render using Splash

I am trying to scrape the link down below which has some Javascript rendering using Splash (in the web Browser). Unfortunately, the search results do not render, exactly as if Javascript was ...
-1
votes
1answer
37 views

Is it possible to generate any number but zero using math.random? [duplicate]

So I'm doing this project where if you click a button it logs a number including 0 and 6, is it possible to not include 0?? Here is my code: <html> <head> <title>Dice.</...
0
votes
0answers
12 views

jQuery Magnify image will not rotate in Chrome only?

I am using the jQuery Magnify plugin. The image doesn't rotate in Chrome unless I press Ctrl+F5. After rotation I tried window.location.reload(true), random query string on JS files, using the ...
0
votes
3answers
19 views

Insert innerHTML of all elements which have same class name to another element

I have some elements have same class name and i insert their innerHTML in another element have classname "show". Expected output is 12345 but it is only show last element's innerHTML(5). Here is my ...
1
vote
1answer
15 views

I want to validate that input-label has a value if other input-control has set certain value

As I said in the title, I have a dropdown list with 2 values - yes and no, and other input label where you can write freely. I want to validate that if user chose "yes", also the input label is filled ...
0
votes
0answers
15 views

svg gradient fill animation percentage jquery

I'm trying to get some svg animation with jquery, for each class "check" i need summs percentage offset for gradient, and when this class is remove need reduce percentage offset gradient. This all ...
0
votes
2answers
9 views

Can sessionStorage.getItem('key') trigger an exception? incognito mode? Any old mobile phone browser?

I'm curious if sessionStorage.getItem('mytestdata') ever can trigger an exception. I'm NOT talking about localStorage.setItem('key', 'value') but rather about sessionStorage.getItem('key') Thank ...
1
vote
1answer
35 views

Why is this undefined in a function defined and called in a JS class method. I exepected this to be window

I thought I understood the mechanism of this in JS but -> I can't explain why if you define and call a function in the method of a JS Class (syntax Class), this value of 'this' in this function is ...
-1
votes
0answers
8 views

Webscraping AngularJS table in R?

I am trying to scrape the table from https://play.stun.gg/replay/e28e9c1e-202b-4332-b2d4-52b38886c32d I'm pretty inexperienced with R, but I've done some basic html webscraping using rvest. However, ...
0
votes
1answer
13 views

Web application is not loading after redeployment

I have the following situation: I have a react web application that is deployed on an NGINX web server via Jenkins. In some cases, my web application does not show up in the browser after I deployed ...
-1
votes
0answers
11 views

Disable cookies with Cookie Consent

I am trying to disable cookies until the user has provided consent. I am using Cookie consent by osana. They are providing a small guide on their website, where disabling cookies should be done with ...
0
votes
1answer
21 views

I am trying to retrieve an array of numbers from an array of object

When I run the generateData() function, it returns an array of NaN. function generateData(name) { var arr = []; var t; const x = name; for (i = 0; i < data.data.length; i++) { ...
0
votes
1answer
29 views

Hide calendar image of date picker

I follow this code and I want to hide image icon calendar of this part of the code, (datePicker.setMonthpicker("#inq_end_dt", inqEndDt);) How to do that? setCalendar: function() { var ...
0
votes
0answers
12 views

Update a Select in a table of items using React

I want to update a Select in a table of items and I have as parameters to send when updating the selected value and the ID of the item and the selected value. I can take the selected value with the ...
-2
votes
0answers
34 views

Function that creates matrix 5x5 + function that creates HTML view of the matrix

I got the following task: "Implement a function numberMatrix() (using JS) which creates HTML view of matrix 5x5 like mentioned below: 1 3 3 3 3 2 1 3 3 3 2 2 1 3 3 2 2 2 1 3 2 2 2 2 1 ! Note: It ...
1
vote
0answers
16 views

How to show function signature/jsdoc of imports in VScode?

When hovering a method in vscode, it shows the signature and jsdoc of the method. However when hovering a function like setState from react, it currently shows a typescript signature (~/Library/...
0
votes
0answers
18 views

How to fix the div element which only appears after resizing the window even just by a bit?

Keep in mind please that the code snipet is only added for so it could be easer for the eyes. I want to display a div, with initaly start of with display:none When the checkbox is checked it should ...
0
votes
0answers
9 views

Html2Canvas Unable to capture image more than once

I am setting up a console contains a large no of div contains data and images and buttons(ex. like mini forms in every div)...want to give user the ability to download certain div as image on double ...
-2
votes
0answers
15 views

Differences between javascript libraries (leaflet, openlayers, googleMaps)

I need some literature to compare the differences between leaflet, openlayers and googleMaps libraries of javascript. Where can i find it, Thanks for answer.
0
votes
0answers
12 views

Second _renderItem in autocomple not responding

I would like to have two or three autocomplete inputs with different datas with _renderItem function. I put it twice in my code but it does not working. Probably I think that I can use .each method, ...
0
votes
0answers
5 views

ReactDataGrid adding data from a form

Using reactDataGrid library I successfully displayed data from an api in a table, now I added a button and when I click the button a form is displayed, completing the form the data, it sends to the ...
0
votes
0answers
6 views

Using Highcharts (and modules) with lit-element

According to a GitHub Issue, this is a follow-up question: I want to use Highcharts and some modules with Lit-Element and struggle during the import of Highcharts and modules. If I use import '...
1
vote
2answers
18 views

Search open escaped square brackets behave different in the “javascript search function” to standard regular expression [duplicate]

With var str = "sdsdTheoDefi[0]sdsds"; console.log(str.search("\[0")); the JavaScript hangs However var str = "sdsdTheoDefi[0]sdsds"; console.log(str.search("\[0\]")); Works ...
0
votes
0answers
20 views

How to use the data from external api in my local express server? [duplicate]

I have installed, request and request-promise from npmjs to fetch data from external API into my local express server. I'm getting data but I'm not able to import that data in another file to use. I'...
0
votes
3answers
27 views

Angular service method to return data after async requests complete

I have a component which is making a call to a service to get data; initAllData(). This method then performs two requests for some json and uses forkJoin to manipulate the data once it has returned. ...
0
votes
1answer
17 views

Fetch API in JavaScript to Save Form Data to a JSON or TEXT File

Can I save the form data as a .txt file or .json file on my system using Fetch API in JavaScript. I dont want the form data to be saved in some PHP file <div> <form> Name:&...
0
votes
0answers
22 views

How to fix my delayed loop which stuck after the 5 seconds?

I would like to create a Jscript which I would paste to the Google Chrome Consol, and it should copy the innerHTML part of an element to the clipboard. This should be done in every for a long period ...
0
votes
0answers
8 views

Fire dialog box when user clicks on external links

There goal is to prevent users from redirect on accidental clicks on external links, when user fills up the form. Problem: the whole code has to be abstract. I don't know which links user clicks, I ...
-2
votes
0answers
13 views

Regex to parse img tag [duplicate]

If I have strings like: <img src="some_url" /> <img src="some_url" style="width:100px;" /> <img src="some_url" style="width:100px;height:230px;" /> How I can parse via regex the ...
-1
votes
0answers
14 views

A calendar picker which downloads the files with entered date as the name of the file

I have files with dates as their names.. i want to create a ui which allows me to pick the date and download the file of the date picked.. For eg: if the date i picked is 2019-05-01 then the file 2019-...
1
vote
1answer
27 views

trying to convert Longitude Latitude via google Geolocation API with no luck

hay guys, i'm new to JavaScript async programming, and i trying to take a file with only Longitude and Latitude and convert it to a street address i converted my table to json file and imported the ...
0
votes
0answers
9 views

How can I view my Updated Data in blade.php from Cookies without onpage loading?

I'm working on a project called Online Food Order with laravel Framework. Here I am storing my data into cookie from menu after onclick add to cart. Now I want to show those data in may cart without ...
1
vote
0answers
27 views

How do I push data to a SQL server using Nodejs and mssql

I am trying to send data to a SQL database usingthe mssql package for node js, here is what I have so far: try { await sql.connect('mssql://<userid>:<userpassword>@<server>/<...
0
votes
0answers
13 views

Problem with 'index' property of bookmarks while creating new bookmarks using Firefox WebExtensions API

While creating new bookmarks in Firefox using the bookmarks.create() API from Firefox Web Extensions, the order in which the new, created bookmarks/sub-folders are placed in the parent folder (...
0
votes
0answers
10 views

Remove an event listener that was added from a chrome extension?

I can't use removeEventListener on document via a button in my chrome extension. I've had a good read about isolated worlds but I can't understand exactly what I'm supposed to do here. I'm not even ...
-3
votes
2answers
20 views

Need some help to add addEventListener for keyup, when i press 'Enter' button

function animatedForm() { const arrows = document.querySelectorAll(".fa-arrow-down"); arrows.forEach(arrow => { arrow.addEventListener("click", () => { const input = arrow....
0
votes
0answers
11 views

How to replicate same Android encrypt method in React-native?

I'm creating a react-native application, where I need to encrypt with TripleDES using ECB mode and Pkcs7 padding. I have an Android Java piece of code that do the encrypt algorithm i want to ...
-2
votes
0answers
12 views

how to create a custom dialog in ContentTools

can anyone provide me a sample on how to show a custom dialog when the user clicks on an image-element? I think this is the code to open a new dialog. But how to bind it to a click-event? var modal =...
0
votes
0answers
13 views

Button looses functionality after rewritng jsp [duplicate]

I am creating a page that is dynamically created with values from the backend and needs to be instantly updated when new values are entered by the user. When a reply is entered and updated in the ...
0
votes
1answer
37 views

How to fix:Parsing error: Unexpected token, expected “…”

I have compiled the below code it's getting me the Parsing error: Unexpected token, expected "..." Error Don't know why. import React,{Component} from 'react'; import EditableContetnt from './Fuck'; ...
-1
votes
0answers
5 views

how to disable peer connection in webtrc. We are not getting client ip in chrome browser

I am using chrome browser but we didn't get the client ip. We are using webrtc api. we need javascript code for disable in enable-webrtc-hide-local-ips-with-mdns.
0
votes
0answers
9 views

Highcharts sets default value for blank data

How to set/supply value (default to 0) for blank data in hours as shown in attached image below. The target result should have all graphs even for blank hours.
-2
votes
1answer
28 views

Why this code goes to concatenation and not adding? [duplicate]

I'm trying to do a function which add 5 each time I'm adding character to textarea, and subtract 5 when I'm removing a character. This is my HTML <textarea rows="4" cols="50" id="my-area"></...
1
vote
0answers
15 views

How to make d3 pages load dynamically with flask/jinja

I'm currently working in a project where we are using flask, where jinja drives the frontend via blocks, with the goal to create a sort of dynamic page. However, I am currently stuck on how to refer ...
0
votes
0answers
7 views

Trying to update LokiJS db but getting 'Trying to update unsynced document' error

Trying to dynamically add entries of people and fruit that they own in Loki JS but I keep getting the Trying to update unsynced document. Please save the document first by using insert() or addMany() ...
0
votes
1answer
10 views

Highcharts set yAxis labels width

Is it possible to set the labels width or other option, so the graph will not move/adjust when label's value is changed. yAxis: { title: { text: '' }, useHTML: true, labels: { ...