Skip to content

Tag: javascript

Two promises with a single then for either one of them

I have a function that takes an input, according to that input it will either call one of two functions (both return a promise) I want then to call the same .then() after whatever of them happened. I found Promise.any() but that doesn’t quite do what I want. For curious minds : I am working on a react-n…

Why the PHP can’t see a value which is coming from ajax js?

When I get my result from the JS side the value comes true. But I want to fill the value to my PHP file, so I’ve used ajax. When I delete if isset function in PHP , I got an “undefined index” error. HTML Side jS side And PHP side Answer You’re sending a value, but you’re not send…

Google Maps Marker Clustering not working

I got this code from this Snippet here that works fine and changed a little bit. But now I wanted to add Marker Clustering to the map like this but I get nothing to work. I added to the head and in front of “markers1 =” but then I get the error I don’t know why this code is not

how to fill in the value in the array

i have code like this in actionscript3, when run, it gets an error in its output what I want is to fill in each “1” value and not remove the “[” or “]” sign so when var nom1, var nom2 are changed Then the output is please helps for those who can solve this problem Answer If…

Simplify passing same arguments two two different functions

I’m calling two functions to which I pass the identical arguments. Can I do something like the following, to declare the arguments once and then pass it to both functions? Answer Yes, you can: Put them in an array and use … (in modern environments) or apply (in older environments): In modern envir…

How can I achieve this using HighCharts library

I am very new to Highcharts. I am developing a dashboard and I need to create a percentage usage of equipment at a Plant. I checked all the demos provided by Highcharts but didn’t find a similar one. This what I need. I know I can do it from scratch but I prefer to use Highcharts if possible. Answer I

Reverting overridden String prototype

I have an overridden String.prototype in my javascript window. I have a reference to an iframe window that hasn’t been touched, and I want to use it to create a new string without the overridden functions: How do I create a new string without the overridden functions? For overridden Array.prototype usin…