How to use ES6 module in another module without importing it in both modules?
I have the following code structureindex.html... <head> <script type="module" src="/cars.component.js"></script> </head> ... cars.jsconst cars = [{...}]; export default cars;...
View ArticlePuppeteer promisifying an event, is this proper event control flow?
I'm trying to get the name of a downloaded file while using puppeteer and I have the following set up, but I'm wondering how best to removeListener, as I want to be able to set and unset this event...
View ArticleCountdown timer for discounted Woocommerce products without plugins
I'm going to create a countdown timer for Woocommerce discounted products without using the plugin on my website theme and I'm looking for code to do it for me using JavaScript or php please help....
View ArticleHow do I get the "control.setRotationSnap" functionality in the Three.js /...
My problem is, that the "TransformControls.js" script from Three.js includes the "control.setRotationSnap" in the code but sadly it isn't working at all!I did my resaerch and could only find somebody...
View ArticleWhy this javascript code doesn't run well?
As a starter of JS, I don't know what's wrong with my code. I guess the bug lies on notifyObserver() Because I use console.log at that point but it doesn't output anything. I don't know how to fix....
View ArticleMapping a string to a specific color everytime?
My Goal: I'm trying to create a pie chart, Every 'slice' will associate with a label. There will be multiple pie charts on the page, and each pie might have a different number of labels, but I no...
View ArticleFails to load Mobile rear camera in Flask using getusermedia()
I want to access Mobile Rear Camera In my Flask Web App.I have tried using getusermedia() api .Its working ,normally rear camera is getting open in html and js files .but when that html and js file is...
View ArticlejQuery - Hide delete icon unless sibling elements are added/present
I have a form which allows users to dynamically add or remove rows by clicking + or -, respectively. But, users shouldn't be able to delete the very first row of any day, so there should only be a - if...
View ArticleArray returns undefined when removing elements
Out of boredom I've decided to make a Russian Roulette game out of Javascript. I've managed to do the bullet part which is a random number between 1 and 6 (16,66%). Everytime the random number hits...
View ArticleCheck if object value exists within a Javascript array of objects and if not...
If I have the following array of objects:[ { id: 1, username: 'fred' }, { id: 2, username: 'bill' }, { id: 2, username: 'ted' } ] Is there a way to loop through the array to check whether a particular...
View ArticleHow to make first li value 0 and then increment by 2 using css counter?
I am trying to make a steps progress bar. When i use the css counter it starts from 2 and goes like 2 4 6 8 10 12. i want it to be 0 2 4 6 8 10 instead. i tried changing the counter reset to 0 but that...
View ArticleHow to merge without duplicatig a data in angular
Data shouldn't duplicate or it should remove the duplicate data. Here's the code: dateList = [ [{ date: "2019-12-12 03:00:00" },{ date: "2019-12-12 03:16:14" },{ date: "2019-12-12 03:16:14" },{ date:...
View Articleexpress js not performing last function
I'm trying to use app.get in order to run functions in a sequence. For the following example, I want to run function "f" after function "t". However, I only get the output from function "t" and not "f"...
View ArticleSome of my markdown text displays properly and some doesn't
I'm making a simple markdown previewer, and when I type the markdown text, some of the text displays properly, and some doesn't (the table, block quotes, the 'multi-line code' don't), also when I...
View ArticleHow to get the value of variable in a Promise? [duplicate]
I have this code in Javascript. Is about of Promises: var some = async () => { let l = await fetch('/cog'); let a = await l.json(); return a; }; some() .then(function(code){ var api = new CApi({...
View Articlehow can i display output value that are different that submit in database
This is an array value which has 2 values like "monday|1 Tuesday|2 " When I choose the day I want to display in output monday|tuesday and in database 1|2 i use checkbox to do the selection option this...
View ArticleHow to use Google Maps Geolocation API?
I am trying to use Google Maps Geolocation API, and checking description by google site but could not understand it.https://developers.google.com/maps/documentation/geolocation/introSituation;・I am...
View ArticleHow can I get div after his appear?
How can I get add__deal__btn and do something with it? When page loads, it does't exist and i can't get it, but after adding it how can i get it?let addTitle = document.querySelector('.add__title');...
View Articleregex how to check regex starts and ends with regex
I am having the regex for capturing string if they are in between double quote and not start or end with /. Now I wanted to change this to match below conditions also.The regex should not capture 1. if...
View Articlereduce the time complexity of nested for loop
Basically I am trying to bring down the time complexity of a series of functions that I haveconst companies = [ { staff: [ { id: 1, qualities: [ { id: 2, tags: [ 'efficient', 'hard-working' ] } ] } ] }...
View Article