Skip to content
Advertisement

How to fix Error: listen EADDRINUSE while using NodeJS?

If I run a server with the port 80, and I try to use XMLHttpRequest I am getting this error: Error: listen EADDRINUSE Why is it problem for NodeJS, if I want to do a request, while I run a server on the port 80? For the webbrowsers it is not a problem: I can surf on the internet, while

How to reset/uncheck radio button onclick event?

I have 2 radio button with 2 group. The structure is like this Main Radio 1 Main Radio 2 Under Main Radio 2, there’s two more sub radio button. Main Radio 1 Main Radio 2 Sub Radio 1 Sub Radio 2 What am I doing is, in default stage, it will only show Main Radio 1 and Main Radio 2

Shorthand if/else statement Javascript

I’m wondering if there’s a shorter way to write this: I initially tried x = y || 1, but that didn’t work. What’s the correct way to go about this? Answer Note that var x = y || 1; would assign 1 for any case where y is falsy (e.g. false, 0, “”), which may be why it “didn’t work”

Raphaël Object: Simulate click

It it possible to simulate an click on an Raphaël object? I tried already Answer Just access the DOM node using Element.node as described in the docs. You can then trigger events on the node as you would with any other DOM element http://jsfiddle.net/UFZXP/ http://lifescaler.com/2008/04/simulating-mouse-clicks-in-javascript/

check if number string contains decimal?

After doing a sqrt() How can I be check to see if the result contains only whole numbers or not? I was thinking Regex to check for a decimal – if it contains a decimal, that means it didn’t root evenly into whole numbers. Which would be enough info for me. but this code isnt working… I bet there’s other

Ways to save Backbone.js model data?

I am more into front end development and have recently started exploring Backbone.js into my app. I want to persist the model data to the server. Could you please explain me the various way to save the Model data (using json format). I am using Java on server side. Also I have mainly seen REST being used to save data.

Advertisement