Questions tagged [javascript]

JavaScript (not to be confused with Java) is a high-level, dynamic, multi-paradigm, weakly-typed language used for both client-side and server-side scripting. Its primary use is in rendering and allowing manipulation of web pages. Use this tag for questions regarding ECMAScript and its various ...

0
votes
0answers
3 views

ASP.Net MVC Full Calendar

I've implemented a calendar, but I'm having some difficulties and problems. When I select an event and click on the edit button ... instead of showing me the data to edit ... the page gives a simple ...
0
votes
0answers
6 views

Position:absolute element inside a div with overflow-y:auto does not show in the desired position

First of all, sorry for the title gore, I didnt know how to put it on a couple of lines. I have this situation: The div that overflows With this element: The absolute element The problem I face is ...
0
votes
0answers
6 views

Defending against XSS attack with mongoose

I am working on a project in node.js which uses mongoose to handle MongoDB. I want to defend against XSS attacks. What is the suggested way to do it? I found this: https://www.npmjs.com/package/...
0
votes
0answers
14 views

how to change browser window location?

Here is a mechanism I have going but I'm pretty sure it's not canonical way to do it, but regardless I cannot understand why it wouldn't work. A form is collected at one endpoint, lets call it /login ...
0
votes
0answers
4 views

Chrome extension, Download a blob file. This is not done correctly on all sites

i currently develop a chrome extension. This extension create a blob and let the user download the "file" blob. My problem is when i create the file, it's on some site it's open correctly, and other ...
0
votes
0answers
7 views

Await for an async queue to be proceeded ( async.js )

relatively new to JS and node I'm playing around with ASYNC.JS with a delayed Log to simulate async call It runs fine until a wrap the code into another block Here s an simple example easy to test ...
0
votes
0answers
16 views

How to update value of input after change of dropdown which is populated by mysql?

I have run into a problem and Im not sure where to start... So my problem is- I need to use a dropdown which is automatically populated by a query concatenating two fields to make a single full-name. ...
0
votes
0answers
6 views

How to test rxjs ajax call with jest?

I have a container component where I'm fetching the data via ajax operator from rxjs const data = ajax(someUrl).pipe(map(r => r.response)); And in my componentDidMount I have data.subscribe((...
0
votes
2answers
7 views

promise async data extract issue

loadcsv(file: File): string[] { let csvRecordsArray: string[]; this.parse(file).then((p) => {console.log(p); csvRecordsArray = p as string[]; } ); console.log('mydata', ...
0
votes
0answers
3 views

lint-staged no stage files match

Used create-react-app template. Windows, OpenServer. package.json { "name": "league-finder", "version": "0.1.0", "private": true, "dependencies": { "react": "^16.5.2", "react-dom": "^...
0
votes
0answers
7 views

HTML entity encode is not working with esc_html() and wp_localize_script()

I'm trying to pass JavaScript object using wp_localize_script() function and expecting an entitiy encoded string in the object. Below is the sample: $params = array('str' => esc_html('this string ...
0
votes
0answers
3 views

Passing an input from form into Coldfusion Query

Hello I am trying to pass a variable who's value would come from a form input to a Query to retrieve a value and pass back to the form as a hidden value.Very confusing, and I hope I am overthinking ...
0
votes
0answers
4 views

Managing online users on server without using websockets

I would like to show a list of connected users without using Websockets. I thought to use http header Connection:keep-alive to get persistent connections. Then, when clients leave the website, they ...
-1
votes
1answer
20 views

The best way for async/await call funtion?

i wanna know if is good or not remove some await from second or third call. async componentDidMount() { try { let response = await this.CollectionManager.GetAllCollections(); if(!...
0
votes
1answer
17 views

Select a subdiv with JS event listener

I'm trying to create a simple buzzfeed quiz with HTML and JavaScript as a practice project. All my options are divs of subdivs in HTML. The four options are a div, the top row of two options is a ...
0
votes
0answers
23 views

Passing PHP variable to a hidden subclass

Just a quick question. Is there some security flaws with passing PHP variables taken from MySQL table to a hidden subclass of some class so that when a parent class when clicked can be passed onto and ...
-2
votes
0answers
23 views

JS Function onload alternative on click

I want initialize_price_slider(); loading once page load . $('#maincontent').on('click',".filter-options-item", function () { setTimeout(function () { ...
2
votes
1answer
21 views

Switch Statement - Multiple results for single case

I have this page: var count = 0; function switchStatement() { var text; var answers = document.getElementById("userInput").value; switch (answers) { case "": text = (count ...
0
votes
0answers
6 views

ASP.NET - Validate Excel File Content

I have a page with a file input where the user is supposed to upload an excel file to insert a large amount of records to a specific table. I found this Javascript code to help validate if the ...
0
votes
1answer
9 views

Why form.id returns child input instead of id?

In w3school specification it says it should return a string representing the id of element. Replicated this issue on Microsoft Edge 42.17134.1.0 and Firefox 62.0.2. Some jsfiddle code required to ...
0
votes
0answers
6 views

click on “plot view” for OpenMCT have a error

I was going through Tutorial telemetry adapter for get start with Nasa OpenMCT mission control framework. at the end of step 4 right step real time telemetry base of tutorial picture i should have ...
0
votes
0answers
4 views

How to get FeatureCollection by loading KML in Leaflet.FileLayer

I am loading a kml file into my map and after presenting this polygon using Leaflet.FileLayer plugin. I want to get all convert kml data into geojson formate. Here is my code: var layer = L.Control....
0
votes
0answers
13 views

Make tab active which contains the search result in wordpress

In my wordpress site, I have few pages which have tabs. The tabs are generated dynamically from ACF repeater fields.Now, when I use the default wordpress search and the result text is inside a tab, ...
0
votes
0answers
24 views

Try to insert any image from an array into an object

I try to add an image to my object at different speeds Constructor this.imagePaths = ['./assets/Bill-Gates.png', './assets/steve-jobs.png', './assets/zuckerberg.png']; this.elementImg.src = `./assets/...
0
votes
2answers
28 views

Javascript color rectangle array

I'm trying to use a pair of for loops generate a 4 by 4 array of 16 small rectangles each with a different color. However, the colors are not changing. var x; var y; var color; for (x=0; x &...
0
votes
0answers
5 views

how can I use ReactNative WebView component to show a specific part of a webpage in my Android app?

I want to use ReactNative webView component in my android app and show just a specific part of a web-page. for example I want to show the contents specified by the red rectangle in the image below: ...
1
vote
0answers
9 views

Communicate React<->Angular Iframe

I know people will say don't do this or why use both.. but I have to. I need to pass data from React(child) to Angular (parent) to React(child) in an iframe. So far I can use window.postMessage ...
1
vote
0answers
7 views

Mail object add inlineImages as BLOB

I use Google script (based on Javascript) to send Mail with MailApp. I am calling the google script function from the Javascript of a web page with google.script.run (that part work fine). I ...
0
votes
2answers
34 views

Convert array of strings to array of objects in JSON property

I have the following JSON returned from an endpoint { "response": { "lines": [ "[{'line':'3007621h7s2','type':'national'},{'line':'3007663f7s9','type':'international'}]", ...
0
votes
1answer
15 views

Date Range doesn't get clones

To get the dates picked in input I'm using data range picker The issue I'm having is that when a input gets cloned the date function doesn't work anymore and I can't seem to figure out what I'm doing ...
0
votes
1answer
27 views

JavaScript array.push() for object [duplicate]

I try to Insert new data in an object as an object. But the problem is when i use array.push() method it inserts new data/data's in a array first then push it into my desire object but as an array. ...
1
vote
2answers
22 views

How to append data in php file

Previously I'm using php to append form data into json file. Currently I am working on php file instead of json file and it has two parameteres and it is shown to users as given in figure Image url ...
0
votes
2answers
28 views

Trouble passing React prop to DOM element

I'm trying to restrict an input to integers. I'm trying to pass the step attribute which seems to work when used directly in HTML, but am having a hard time getting having it passed from react. Below ...
0
votes
1answer
8 views

stroke-dashoffset animation with keyframes and css variables

Either I'm crazy, or I've found a weirdness with keyframes and svg animation. I'm simply animating an SVG stroke around a circle that in effect creates an animated percentage dial. As soon as I ...
2
votes
2answers
19 views

Key definition for tables generated in React

I'd love to know how to generate a dynamic table within react, but provide each of my rows of data with proper keys for react to do it's magical stuff. Here is an example of simple table/row ...
0
votes
4answers
21 views

Bootstrap navbar doesnt expand after collapsing

I am new to bootstrap and JS and I've almost exactly followed the documentation but for some reason my button doesn't expand on click. I've checked other similar answers on SO, but all of them were ...
0
votes
1answer
21 views

A simple Javascript game called Traceball

I need help/advice on how to sort out an issue I have https://raw.githubusercontent.com/TalvinJoshuaJacobs/TraceBall/master/src My task is to code a game in Javascript and HTML where the user has to ...
0
votes
0answers
10 views

How to upload an image file to AWS S3, after changing the orientation using Javascript?

I'm using the library Direct Upload to S3 - Signature V4 to upload photos. However, I have a requirement to find and correct the orientation of photos, before these files are uploaded to S3. I have ...
-1
votes
2answers
25 views

Limit fetch resluts from javascript fetch

Is there a function similar to q=sort& or q=created:& to limit number of results from a JavaScrip fetch? > fetch('https://jsonplaceholder.typicode.com/posts') .then((res) => res.json(...
0
votes
0answers
3 views

Clone sapUi5 json model and stop binding

I have seen a similar question, but in my case it doesn't work. I have a JSON model, called data, which corresponds to a SAPUi5 form with comboboxes. I want to copy the state of the model the first ...
-2
votes
1answer
18 views

How To Create Link With ID in JS

I Want To Create Link Like: google.com/#payBtn The #payBtn element is my number And should display google.com/56000 For Example : $("#payBtn").click(function() { $("#count").html($("#...
0
votes
0answers
6 views

Get Google Drive ClientID

I want to add my Google Drive Client_ID on javascript file when I login in my project. When I get this value,I can upload or download files in drive. I can not want to add my Client_ID manually.Since,...
0
votes
2answers
24 views

Why does event delegation ES6 listener track input clicks as button clicks?

I am not sure why when I want to listen for input clicks separate from button clicks it does not discriminate? I put the listener on the UL for this as the LIs are dynamically added (event delegation)....
0
votes
0answers
15 views

Rest API Patch only 1 field at a time

I'm working on an inline grid editor that calls an express rest api after a single value in the grid is updated. So when a user changes a single field in the grid, I am calling a PATCH request to ...
0
votes
1answer
16 views

creating a memory game followed last step to update grid with front and back for cards now grid isn't displaying correctly

I have been following this guide on making a memory game. https://www.taniarascia.com/how-to-create-a-memory-game-super-mario-with-plain-javascript/ I was on the last step of updating the grid to ...
0
votes
1answer
34 views

Why does JQuery $.post submit twice?

Why does this call my Action twice? For background, using .change only works when a user clicks somewhere else on the form. Also .change will not fire when the browser is closed. Hence the timer ...
0
votes
0answers
18 views

How to call a function from a script file into a button click event in javascript HTML?

I'm working a 3D viewer project. Currently I have divided the HTML into two one that contains a button, and the other contains the viewer itself. The end goal for me at the moment is to press this ...
1
vote
0answers
26 views

Jquery textbox empty function not working on html website

On my live website page here is I am facing an error that is 'I want show an alert when Name & Email textbox will empty. I am trying to solve this issue today all hours but I didn't solve this , ...
0
votes
1answer
35 views

How do i implement callback/await to my code?

So, I have been working on this code for the past few days and tried to implement callback/await/whatever is needed to no avail. The question is, how do I wait with the response until I get let's ...
0
votes
0answers
5 views

connect to Itunes API and display datas

I am trying to connect to itunes API and i have an error. What am I doing wrong? var request = new XMLHttpRequest(); request.open('GET', 'https://rss.itunes.apple.com/api/v1/es/apple-music/top-...