Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Browsing all 139833 articles
Browse latest View live
↧

How can I make asynchronous code to execute before continuing

I'm quite new to hooks and in react in general. I came accross a problem I couldn't solve so here it is. I have a quotation function that is suppose to calculate the cost price of a benefit. const...

View Article


How to access child component data in parent component vueJs?

I am having Vue Application and I am loading different child component's based on the values selected from parent component . When I am clicking on submit button which is in parent component I want to...

View Article


React Tests fails when i use document.getElementById (Jest+Enzyme)

I am working on a React form and have an onSubmit function to it. I only added below lines in onSubmit function. const id = this.getErrorPositionById(); const errorPosition =...

View Article

Can not use 'yield' as identifier inside a generator

While composing an async generator function, I noticed that the following construct results in a SyntaxError:async function * foo() { await yield bar; // Can not use 'yield' as identifier inside a...

View Article

How to open HTML page in JavaScript

I have an .html file (X) that depending on some value should immediately open another .html file (Y) when opening the .html file (X). What's the best way to implement this within javascript?Also I want...

View Article


Javascript async how to make main thread stop to wait for result? [duplicate]

This question already has an answer here:How do I return the response from an asynchronous call? 36 answersJavascript async and await is confusing the heck out of me. I am just trying to a simple DB...

View Article

Image may be NSFW.
Clik here to view.

How to simulate a phone frame playing videos on my website?

I want to show videos on my website, but I want those video to be inside a phone frame, for eg I want the video to be playing inside something like that white phone frame.Hope I was clear enough. But I...

View Article

Image may be NSFW.
Clik here to view.

Electron dialog object not return anything, says Promise { }

I am trying to implement I/O Operations on this tutorial App I am building. Everything else is working correctly, the only problem I am having is that the application does not console.log() the desired...

View Article


Nodejs endpoint to search inside json file

ENDPOINT now searching hardcode app.get('/search', function (req, res) { res.send('id:' + req.query.id); searched="search this"; search(searched); }); FUNCTION TO SEARCH function search(searched){ var...

View Article


Check if falsy except zero in JavaScript

I am checking if a value is not falsy withif (value) { .. } but I do want to accept zeros as a (non-falsy) value. How is this normally done? Would it beif (value || value === 0) { .. } or what?

View Article

How to get file hash name in Angular?

In Angular 4 I've used Webpack's (or even File-loader's) require method to get Image hash name:const versionedName = require('assets/images/icn-copy.svg'); It returns something like...

View Article

Typescript Type for Dynamic Array.map Callback Function

In my Angular 8.2/Typescript 3.4.3 app, I need to generate an array.map callback dynamically, but the TS linter is barking about that function. Here is an example snippet I contrived to...

View Article

I am trying to make a program to get the time left in my classes but the...

Here is my code, can you tell me why it isn't working? it is coded in repl.it javascript. it runs by defining the class start/end times but it is only defining the regular time and every thing i do...

View Article


Image does not show up when using Inner Join to retrieve data from DB [closed]

When ussing inner join to do my query, images on my site appear broken. Example below.Query without using inner join: public function crudProduct() { $product = Product::where('products.status', '=',...

View Article

Regarding custom builds in Ember

How do I extend my custom environment (and build), for example, "staging" from production?Ultimately I want to do ember build --environment=staging, reap the goodness and optimization provided by...

View Article


Get value of json from api link

i have a api link from a game "https://www.erevollution.com/en/api/citizen/1/"and i want to get energy value<!DOCTYPE html> <head> <title>AutoHit for eRevollution</title>...

View Article

I can't call the function in prototype .js. Where am I making a mistake?

Code:DeCheBX = $('MyDiv').insert(new Element('input', { 'type': 'checkbox', 'id': "Img" + obj[i].Nam, 'value': obj[i].IM, 'onClick': SayHi(id) })); document.body.appendChild(DeCheBX); DeImg =...

View Article


JCROP - Can't select crop area on mobile devices after destroying one jcrop...

I have these 2 imgs <div class="row"> <div class="col col-12"> <img src="<?=$urlArchivos.$_GET['tp_foto1']?>" id="target" alt="" /> </div> </div> <div...

View Article

undefined value from return - event

I would like to return from the function of an event some value. Bellow, you can find html and js where I've put a button. I would like to have an output true or false. I have only information about...

View Article

How to create a different random number for every single div with React on...

I would like to get a different random number for every single div every time that I click on the image. At the moment, I am receiving the same random number for all div elements and I have no idea,...

View Article
Browsing all 139833 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>