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).

-1
votes
0answers
5 views

Remove Image feature conflict with Dragging

Background : User click on Mask & upload their own image on the mask. Once image uploaded, Remove Text is displaying on the image. Once user click on Remove Text, we are deleting the uploaded ...
0
votes
0answers
13 views

myFunction = () => { } does not work in chromium but is ok in chrome?

I am developing on win7+Version 74.0.3729.169 .. here everything is fine. then I deploy to my raspberry where I have Xserver+Chromium 60.0.3112.89 running. on the raspi, chromium gives me a syntax-...
0
votes
0answers
7 views

Accessing value in nested object

I don't understand how I can access an value in a object that is an array with an object inside itself. I've tried with the dot notation and [] and array.reduce. But I'm doing something wrong. I've ...
0
votes
0answers
11 views

Using setState in onFocus removes the focus

I found that the convention to changing css of TextInput is by changing the component's state using onFocus and onBlur props. I learned it from this post. However, though successful I had to do some ...
2
votes
0answers
6 views

How to use react-easy-crop to reflect position changes from react-easy-crop to live image rendered in another div?

After selecting an image i am rendering it in two places, one is in react-easy-crop(4:3 aspect ratio) and another is in separate div(960w*510h).so when ever i change my crop position in react-easy-...
0
votes
0answers
16 views

Do not allow user to delete coma/dot if

I'm using regex from other question, but i found a problem in my case with dot. I want to allow user to place max 3 digits numbers then coma or dot which one I'm replacing on dot otherwise, then max ...
0
votes
0answers
2 views

Sync view component with DOM and Redux state

I would like to know how can I sync the view with my redux state please. Currently I have this component : ... handleChange(e) { console.log(e); this.props.updateMessageOnBlock(this.props....
-1
votes
1answer
16 views

Replace string which is between two characters [duplicate]

I am having the following string 4 (10.3%) and would like to receive 4. I tried: let s ="4 (10.3%)" s.replace("/\s+\((.*?)\)", ""); console.log(s) However, I still get the initial ...
0
votes
0answers
12 views

Insert PHP function in Javascript

Can you please help me. How to add this PHP code: <?php echo short_title(' ', 3); ?> Here : <a target="_blank" href="https://www.amazon.com/gp/search?ie=UTF8&tag=abc=<<<Insert ...
1
vote
0answers
7 views

Creating a custom command as an alternative to setValue() where I can control the type speed

Hope someone can help with this. I have come across an issue with the application im testing. The developers are using vue.js library and there are a couple of fields which reformat the entered test. ...
0
votes
1answer
26 views

convert the data from Input to the output data in json format using javascript code

I have an array like [ { "category": "Red", "source1": 20, "source2": 30, "source3": 40, "source4":50 }, { "category": "Yellow", "...
0
votes
0answers
28 views

how to check equality between and array and html table value

I check the equality between an array value and html table cell value both are same but how can i check this. I try this but it wont work properly. it always return true if there are same value. check ...
0
votes
0answers
5 views

How to prompt the receiver to display [title / subtitle / thumbnail] card on screen?

I'm developing a receiver app using googlecast CAF SDK, in some cases I would like to display the metadata card on screen to reflecting the media information change, but it seems ...
1
vote
2answers
10 views

Can't stop express server in after function

I have Node tests with this before function: before((done) => { app.startServer() .catch((err) => { done(err); }); }); I'm now trying to write an after function which will stop ...
3
votes
1answer
22 views

using await inline on variable in outer scope

(async function iife () { const numbers = [1, 2, 3, 4] let count = 0 async function returnNumberAsync (number) { return new Promise(resolve => { setTimeout(() => resolve(number), ...
0
votes
0answers
5 views

How to use jest to test blocks in Meteor.methods

I am writing jest test to my meteor project. I am trying to test codes in the Meteor.methods, but I am not sure how to do it with Jest. On the server side (which is also main.js), the code snippets ...
-1
votes
2answers
24 views

Restarting setInterval after using clearInterval in Javascript

I am trying to make it so that there are two buttons using Javascript, one to stop the image carousel using clearInterval which works well, however, I also want another button to restart the carousel ...
0
votes
2answers
33 views

Make shorter code in javascript using if else conditions

I know about the ternary expression i javascript. However i don't know how to make this piece of code shorter. if (x == false) { x = true; cancelAnimationFrame(BI.req); } else { x = false;...
-1
votes
3answers
25 views

I am trying to check if given value exist as key in array of objects

I am trying to check if given value exist as key in array of objects var obj = [{ tapCount1: '10' }, { tapCount2: '500' }, { tapCount3: '1250' }, { tapCount4: '1250' }, { wtOfSample: '41.00'...
0
votes
1answer
17 views

vue js doesn't show props component properly

I built a component with a 'date' property called datesel : <booking-table :datesel="23-05-2019"></booking-table> I tried to display it in my component but instead of displaying the ...
0
votes
0answers
3 views

Export Canvas animation to interactive PDF using Angular 6

Is there any way of exporting canvas containing animations to interactive PDF? Something to allow user to save that canvas content to an interactive file? I have briefly explored jspdf and html2canvas ...
0
votes
0answers
12 views

Too many URL get request sent to server for django ModalForm in jquery

I am trying to open a django modalForm. Since the specific URL to this modalForm is depending on a tablerow I calculate the URL on a mouseenter event and sent the url to the server on a click event. ...
0
votes
0answers
7 views

JS code to reference row/column in Bokeh DataTable erroring

I've used previous posts here and here to try and run code whereby I can select a row in a DataTable in Bokeh, and get the row number. However I'm finding that using that code, once I get past row 6 ...
-3
votes
0answers
28 views

Only one character in a tablecell in html? [on hold]

Im making a Sudoku game and in each tablecell should only be one character. How? I've tried allmost everything, but nothing really worked.
0
votes
0answers
4 views

join HTML segments from different origins and load correctly in a browser

I want to join HTML segments from different origins and then load the final one correctly in a browser. For example, one HTML segment excerpted from www.1_example.com/1 might contain <img src='/...
-6
votes
0answers
23 views

Converting a Json data from one form to another

I have a json data which is being received in this form: [{'Date': '12/05/19', 'HourData': [{'hour': 10, 'inCount': 46}]}, {'Date': '13/05/19', 'HourData': [{'hour': 6, 'inCount': 5}, {'hour': 8, '...
0
votes
0answers
9 views

what does this 0x7fffffff mean in this function and where can i learn more about it [duplicate]

want to understand this and learn to implement it myself what does 0x7FFFFFF mean where can i look to learn more var secureRandom = function(count) { var rand = new Uint32Array(1) var skip = ...
2
votes
1answer
39 views

How to write javascript for multiple inputs?

I'm using multiple inputs in my application and I want to filter the 2nd dropdown based on the selection of 1st dropdown. @foreach (range(1, 5) as $x) <table> <tr> ...
-1
votes
2answers
15 views

How to use console with console.dir(“string”+object)

Here is my code: var foo = { age:20 } console.dir(`hello:${foo}`) I expect hello:{ age: 201 } but I got 'hello:[object Object]' and if I don't want use console.log("hello") console.dir(...
1
vote
0answers
12 views

How to change an Audio Element's currentTime using an Custom Progress Bar on Touch Devices

I'm making an Web Audio Player. I am able to make an custom Progress Bar for it. Problem is that I can only Drag the Progress Bar on Non Touch devices and in Touch Devices I can't Drag The Progress ...
0
votes
0answers
5 views

Chrome extensions do not respect browser_specific_settings

The W3C Browser Extensions Community Groups has been working for a while on compatibility between browser extensions on different platforms (Chrome/Firefox/Edge/Opera/Etc.). They have a list of keys ...
1
vote
0answers
11 views

Approaches to Extend ng2-pdf-viewer to support drawing on top of pdf?

I am making use of ng2-pdf-viewer as a PDF Viewer Component in my application, now I want to extend the component to support drawing on top of pdf, in summary adding a pencil or something that will ...
1
vote
0answers
10 views

Change event ending while changing its' position by dragging it in FullCalendar

I'm trying to create dynamic duration of currently dragged event. How could I achieve this? I've tried setting event end via setEnd in eventPositioned with proper checks, since setEnd fires again ...
-1
votes
3answers
32 views

Change boolean in the array of objects

I have radio buttons and i need change selected radio button to true and other to false changeHandler (index, event) { this.array[index].checked = true; } I have the following array structure: [...
1
vote
0answers
23 views

How can I delete a button in a cell and replace it with a text/number?

I'm preparing a react-table and there is a column of buttons. When clicked, there is another column that updates according to the row number that was clicked. I want to remove the separate column to ...
1
vote
1answer
20 views

Fill HTML select with options from Web.config

I have an HTML page, with a <select> which has a few options in it. Currently, these options are hardcoded into the HTML. Is there a way to get a list of options in Web.config, get them in my ...
0
votes
0answers
14 views

Issue with loading bar in JS

I've got this code to run a progress bar to match the progress of the upload of a file in JS, it was working fine but when I added a line of code and then delete it because I changed my mind about it ...
0
votes
0answers
12 views

How to readrecords from Json Array

I try to use Javascript Ext libraries and call a rest service which returns a json response. Its an array with one element and it doesnt work when i use DataReader(Ext.data.DataReader) "readRecords" ...
-2
votes
1answer
12 views

document.getElementsByclassName is not a function

i want to create tab using javascript. but its not working. it saying that my document.getElementsByclassName is not a function. <script> function openTab(evt, objectiveName)...
-2
votes
0answers
6 views

How to make gameInstance style hidden in WebGL Unity?

Trying gameInstance.style.visibility ='hidden'; Not Working (gameInstance.style is undefined). What should i do?
0
votes
0answers
7 views

Array concat of the Uint8Array, output of the Chip And Pin Device

I'm getting a output data from a device as series of array. This array comes 5 times each time carrying a 64 item in it while swiping a card into the device. I want to concat these array. Below is ...
0
votes
0answers
5 views

Node.js: OAuth2Strategy requires a clientID option

I am setuping the MERN stack project, which was created by another developer and I am getting the error: node_modules/passport-oauth2/lib/strategy.js:82 [0] if (!options.clientID) { throw new ...
0
votes
0answers
15 views

Posting a new variable to my route is not possible via postman

Yesterday I tried to post new 'tickets' via Postman and this worked. Today I tried again and I'm getting a 'uuidv1 is not defined' error. This is the code in my TicketRoutes.js: var express = ...
-3
votes
1answer
19 views

Get older versions of v8 engine installed on my machine. so I can run and test my js files through it

I want Google D8 engine version 3.14 installed in my machine so that I can test and run my JS files through it.
0
votes
0answers
12 views

Changing Animation's duration with jQuery's `elem.css` not working on iOS

I'm trying to make a web service that make musicians to keep the tempo by watch the device changing it's display's color. Here's the Code. and Service. click anywhere to show/hide header. you can ...
0
votes
0answers
4 views

How to edit chart data using office.js within Microsoft Word

I'm creating a word add-in using the word javascript api that pulls data from database, allowing users to create tables/text with the data. I would now like to add the functionality to change charts ...
2
votes
0answers
22 views

In Angular I want to project the nativeElement to another component without using innerHTML

In Angular I want to project (Transclude) a nativeElement to another component without using innerHTML. Currently I'm trying to do this using ngComponentOutlet using a child component that has an ng-...
-4
votes
0answers
27 views

How to create a donut shape with dynamic, equal slices [duplicate]

I'm sitting on a problem where I want to create a donut shape with dynamic, equal slices. I didn't find a way yet to achieve it. The 'hard' part is that the circle in the middle has to be transparent. ...
0
votes
2answers
26 views

Bootstrap Datepicker not responsive

I have a bootstrap datepicker in a div. Everything works fine until i reduce the window's dimensions. The code is the following: <div class="col-md-3"> <p> Pick a Date: </...
0
votes
0answers
6 views

webrtc not working with public candidates behind cone NAT

I'm trying to set up a webrtc connection without TURN, only relying on public candidates generated with STUN. I know for sure that I am not behind a symetric NAT (NAT configuration indicates that "...

http://mssss.yulina-kosm.ru