Skip to content
Advertisement

Simplest way to detect a pinch

This is a WEB APP not a native app. Please no Objective-C NS commands. So I need to detect ‘pinch’ events on iOS. Problem is every plugin or method I see for doing gestures or multi-touch events, is (usually) with jQuery and is a whole additional pluggin for every gesture under the sun. My application is huge, and I am

JavaScript fileWatcher

I am developing a web application (intranet) and it is mandatory to watch a specific folder, for example c:docs, for inserted files. I would like to do that through JavaScript in order to detect each time the client inserts file into specific directory. Answer You can build your own application using django. It has very safe methods to handle user

Javascript event that runs before page changes

Is there such a thing? I know that I can hook my function on the click event of all links, but there are other situations where a page is changed, like refresh or when a different script changes the window.location In the end, I did it by sending a string trough postMessage from the unload event, like this: in the

How to detect radio button deselect event?

Is there an easy way to attach a “deselect” event on a radio button? It seems that the change event only fires when the button is selected. HTML JavaScript jsFiddle ​ Answer Why don’t you simply create a custom event like, lets say, deselect and let it trigger on all the members of the clicked radio group except the element

Fast way to get the min/max values among properties of object

I have an object in javascript like this: Is there a fast way to get the minimum and maximum value among the properties without having to loop through them all? because the object I have is huge and I need to get the min/max value every two seconds. (The values of the object keeps changing). Answer There’s no way to

Why is process.env.NODE_ENV undefined?

I’m trying to follow a tutorial on NodeJS. I don’t think I missed anything but whenever I call the process.env.NODE_ENV the only value I get back is undefined. According to my research the default value should be development. How is this value dynamically set and where is it set initially? Answer process.env is a reference to your environment, so you

Wait until setInterval() is done

I would like to add a small dice-rolling effect to my Javascript code. I think a good way is to use the setInterval() method. My idea was the following code (just for testing): Now I would like to wait for the setInterval until it is done. So I added a setTimeout. This code works quite okay. But in my main

Advertisement