Newest 'javascript' Questions - Stack Overflow

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
11 views

How to find value in multiple different array in javascript

i have 3 array and i wan't find value in it but it run well in first arr. Somebody tell me, what's wrong var find = 2; var value = 0; var 1= [1, 2, 3, 4]; var 2= [5, 6, 7, 8]; var 3= [...
1
vote
0answers
6 views

On the browser, is there a way to programmatically create a calendar event for iCal without having to create an .ics file and download manually?

For my application, I need to programmatically create a calendar event and populate it on the user's local Mac iCalendar from the browser. I found libraries that help me create an .ics file, and I ...
0
votes
0answers
12 views

how to filter product from mulidimensional array

I have array i want to filter product for ["Front Camera", "16 MP"] and Above all product id shows for ["Front Camera", "16 MP and Above"] then i do filter ["Ram", "4 GB"] all product id show for ["...
0
votes
0answers
9 views

Filter files read using readdirp

I am using this readdirp npm package to read files inside nested directories. And it has option to filter files also. By using that i added the file filter readdirp('.', {fileFilter: '!image001....
0
votes
0answers
6 views

react-native-snap-carousel returns “Cannot read property 'concat' of undefined” when I use renderItme

I am learning React-Native and using react-native-snap-carousel in my project. I want to show some images but I got error Cannot read property 'concat' of undefined. Here is my code. const HomePage ...
0
votes
0answers
8 views

TypeScript - Send optional field on POST only when there is value

I am using Formik, in my React application. I have a simple form with 3 fields. I am doing 2 operations with that form. Add/Edit Resources. My Problem is that one field is optional. Meaning I should ...
0
votes
0answers
3 views

can't get multiple line graphs to appear

I want to get multiple line graphs to appear similar to Mike Bostock's design (https://bl.ocks.org/mbostock/1157787). I feel like my code is appropriate but no line graphs appear. Html elements and ...
1
vote
1answer
15 views

add array of keys as property on obj as accumulator by reduce?

i have array of keys that i want to add as property with calculated val(not including on code) on empty object like this by reduce: const f = ['a','b','c'].reduce((obj,key) => obj[key]='', {}) i ...
0
votes
0answers
5 views

How to use tawk.to API on hybrid mobile app by phonegap?

I want to use tawk to on my hybrid mobile app build by phonegap, i copy the api script to my document, i try on my localhost first and it run properly, after i build with phonegap it does not run. ...
0
votes
0answers
18 views

How to stop blur() event function to trigger twice?

I am trying to fetch the records from the database using blur function. There are two input fields where this function triggers. I have used different names, variables, javascript, controller using ...
-4
votes
2answers
41 views

What is the meaning of this below code? I am just beginner

I am having problem with understanding the below code @Component({ selector: 'app-heroes', templateUrl: './heroes.component.html', styleUrls: ['./heroes.component.css'] }) export class ...
0
votes
0answers
12 views

Export content to pdf angular using jspdf

I am trying to create a pdf using jspdf. However I'm getting error cannot create property 'header' on string 'Details'.I went through this question How to fix: Cannot create property 'header' ...
1
vote
0answers
11 views

property classList does not exist on type 'GlobalEventHandlers' when used with angular typescript

I am implementing Collapsible in my angular application. I have written CSS in .css file and html in .html file. And JS I have coded into .ts file as per following code. export class HelpComponent ...
0
votes
3answers
32 views

Why isn't this code working when i try to use IFFE

I tried to run this code. var temp = (function () { var a =10; return { function (a) { console.log('Value of a is ' + a); } } })(); temp(); I expect IIFE to return the function and ...
0
votes
0answers
8 views

Styling react-select component

just started using react-select. I was able to get the overall styling done but had to do a couple of things that I feel can use some improvement, for example I have a const which sets the selectStyle ...
0
votes
2answers
41 views

How to keep focus on input first field

I had a little complex task to do which I have already completed almost, but only stuck at one place What I am doing i have 3 input fields on my UI followed by a HTML table, the Input field is ...
0
votes
0answers
5 views

Facing issue while establishing solr

I got this error like "SolrCore Initialization Failures {{core}}: {{error}}" I don't know why this happened.. Can anyone have similar experience like me?
0
votes
0answers
6 views

MobX full recompute on read though observables don't change?

I have a mobx store that looks like class EntityStore { rootStore @observable entityIndex = {} constructor(rootStore){ this.rootStore = rootStore; } @action addEntities(entityArray){ ...
-4
votes
1answer
19 views

Recommend js framework / library for primitive UI responsive graphics [on hold]

Please recommend simple lightweight opensource 2D graphics js library that allows to do this: Draw primitives on canvas: circle, line (with width), polygon, text, put an icon. All of the primitives ...
0
votes
0answers
5 views

PayPal Express SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data button.js:410:41

I receive this error: ''' SyntaxError: JSON.parse: unexpected end of data at line 1 column 1 of the JSON data button.js:410:41 https://www.sandbox.paypal.com/webapps/hermes/static/js/button.js?build=x ...
0
votes
8answers
44 views

Find which variable has smallest value

I have three variables like below x = 3; y = 1; z = 2; How do i get the smallest one ? That is y. Right now I do it like below if(x < y && x < z) { var smallest = x; } else if(y < ...
-7
votes
0answers
20 views

need to create new array called result with key/value from posts and inside that reviews array with user and comment key/value objects

for below input data: let posts = [ { "id": 101, "title": "Some post title" }, { "id": 102, "title": "Some Another post ...
0
votes
0answers
29 views

Parse javascript in <script> tag in .html file to documentation

I may have a particularly unique use case, but i'm interested in. I need to only document the javascript in the <script> tag of a .html file. The files can't be split up due to vendor ...
0
votes
0answers
6 views

How to add events in chaincode? (Hyperledger Fabric)

I am trying to make events work in Hyperledger Fabric. I have written the setEvent function in my chaincode and added a listener (addContractListener) in my application file. Nothing seems to happen ...
0
votes
1answer
25 views

Struggling with jQuery delay popup form

I'm hoping for a little assistance with an issue i'm having. I have a popup on my site 'newsletter-popup-conatiner'. (yes, that is a the actual misspell of container used throughout the site) From ...
-8
votes
0answers
31 views

Having problems with java [on hold]

i am beginer on expert system..i have a test on java.. i also have jcheckbox and i want this jcheckbox pass information result to jess. its just for a prube. i make this code but doesn´t work: (...
1
vote
0answers
13 views

Discord.js - Problem with promises being “overwritten”?

Alright, so I'm practically finished with this Discord Bot that I have been building in JS. I'm having a problem with new promises being resolved before old ones have completed, resulting in ...
3
votes
0answers
18 views

Should I write an algorithm that decrypts a string into a list of items or force the dowloading of an updated DB regularly for a React Native App?

Without revealing too much about my program; I am creating an app that helps manage inventory of products in storage units. The problem is that the app needs to function without internet connection ...
1
vote
2answers
27 views

Export data from table to excel, how to stop excel from auto converting the value?

I am currently working on an export function on a project. (I am a fresh graduated student) I had successfully done the function. the issue I facing now is the excel will auto convert(or format?) my ...
3
votes
1answer
29 views

cannot csroll on page after modal closes

I have a modal to update data. when the update is complete the modal closes and I cannot scroll on the page afterwards. modal <div id="catupdate" class="modal fade" role="dialog"> <div ...
0
votes
0answers
31 views

How does var and let affects the working of code? [duplicate]

I am new to JavaScript and has shifted to JS from C++. There are some differences between the two languages which is making it difficult for me to understand some concepts. The following code gives ...
2
votes
0answers
17 views

Creating simple plane and updating it's position in Three.js

I'm just starting to learn Three.js. I want to create an empty / transparent scene and a plane who's position get's updated by my function called updateLocation. function initView() { // ...
0
votes
1answer
44 views

Converting ES6 javascript function code to non-es6 code

Trying to use a complex decryption logic into own script but code is ES6 which I have no idea about. const parseDecsig = data => { try { if (data.startsWith('var script')) {...
0
votes
1answer
30 views

How to declare an array with objects in the state ReactJS

I am wondering how to make new blank array with objects in the state and how to add element in it with setState. I want the array so: newhosts: [ { activityState : "", platform: "",...
2
votes
1answer
29 views

How to passing the data from tap() to takewhile()

I want to build a function to check if the inserted data is valid. Below is my code, which will have a map() and a take() function to make sure the checking function will not run more 10 times. What ...
1
vote
0answers
16 views

Kendo UI Grid Editors Based on the Column Values of the Grid

I found this article in the Kendo UI documentation and it's almost identical to my issue that I'm stuck with. Once I open in Dojo I edit some lines of code, especially I change to editable:"inline" ...
0
votes
0answers
8 views

How to implement a correct filtering in ember.js

I have a modelA, modelB, and modelC. modelA hasMany modelB, modelB belongsTo modelA, modelB belongsTo modelC. Below is my computed property on my component.js and the code below is I want to get all ...
3
votes
1answer
30 views

How can I restore proper function of the tab key and traverse all form inputs?

I'm building an interactive speed calculator and I want desktop browser users to be able to navigate and provide inputs using the keyboard alone if they wish. Codepen here: https://codepen.io/mannadu/...
2
votes
1answer
49 views

What is the fastest and most efficient way to filter 45,000 entries in array?

I would like to filter entries in an array that select only from stocks ('Common Stock') and in NYSE and NASDAQ exchange. I have 45,000 entries in array and want to write something in JavaScript that ...
0
votes
0answers
19 views

Convert JSONPath back to JSON object [Javascript]

Using NPM: jsonpath to get all the JSONPath's matching an pathExpression from an JSON object. Something like "jp.nodes(obj, pathExpression)". Is there a way to construct back the JSON object from the ...
0
votes
0answers
14 views

How to create a map function by testing each attribute of an object with javascript / nodejs [on hold]

I get an object from a firebird database where I do not know what the attributes of the object are, and for each attribute check if it is a string or an object I am doing this using the node-firebird ...
0
votes
2answers
42 views

Promises and Order of Operations

Apologies if this is a basic concept. I'm new to Javascript. I'm trying to understand the order of execution of the following functions. I setup a Promise with 2 callbacks and a Promise with 3 ...
-1
votes
0answers
7 views

why unexpected token operator error from UglifyJs?

ERROR in client.js from UglifyJs Unexpected token operator «=», expected punc «,». Webpack is 3. Didn't understand what the issue.
1
vote
3answers
51 views

how to change background of div (like progress bar) when user finished inputting a form?

I want to change background of div when user fill all the input in a part of form. Is there any way I can get it done but to place a button in it and click that button to change the background ....
-2
votes
0answers
7 views

Scrape data from website that redirects links to its homepage

When i click on any link on webpage it opens and works well. But when i copy that same link for google search it redirects me to its homepage. Even i cant open link in any new tab or window. Same ...
0
votes
0answers
11 views

Best way to updated a Web Service Call done in PHP after the page has loaded

I have a webpage that uses PHP to make a REST API call and returns an JSON array used later in the page. This php is meant to run on loading (yes, I understand php is ran server side), but it ...
0
votes
1answer
19 views

Why is ob.constructor.prototype == ob.__proto__

Say if we create an object var ob = {} When I check ob.constructor.prototype == ob.__proto__ both are same how is it possible?
3
votes
2answers
27 views

How to autoclick a button (stimulate a mouse click on load)?

I am taking a website design class and my first project is to stimulate a mouse click for an audio player when the page loads. My website is split in 3 files: HTML, CSS and JS. The current code is: ...
1
vote
1answer
14 views

how to get percentage of battery from OS or something using javascript

I wanna get the my laptop's percentage of battery from OS or something. But i don't have idea about the way i got it. i use javascript, css, java and python(Actually, python is beginner) So, My ...
1
vote
4answers
35 views

Algorithm challenge: Repeating a string

just learning JS and am going through Algorithm challenges. The below code should repeat a string (str) x (num) times. So for example repeatStringNumTimes('*', 3) should be '***'. The below code ...