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
Check if at least one checkbox is selected PER questio.n
Here we go again , searched and tried myself but none of the online examples are not the same as in my case. I have 2 radio based question and other 22 with checkboxes. My question is how to check if at least 1 checkbox/radio is selected on each question and display javascript alert in case they are not EG
View JSON file in Browser
It is not a programming question, but need your views in few words. When we hit the JSON url in Broswer, it asks us to save the file. Why this happens ? Is there any way to view it on the page itself ? Is there any addon available to view JSON file in browser? Answer In Chrome use JSONView
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”
How to calculate coefficients of polynomial using Lagrange interpolation
I need to calculate coefficients of polynomial using Lagrange interpolation polynomial, as my homework, I decide to do this in Javascript. here is definition of Lagrange polynomial (L(x)) Lagrange basis polynomials are defined as follows Calculate y value for specific X (W(x) function) is simple but I need to calculate coefficients of polynomial (array of [a0, a1, …, an]) I
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/
How to control animate function on button click?
I have two divs named “arrow” and “inner”. I am trying to control the animate slide function when the div is clicked but have been unfortunate. The issue is noticeable when clicking very fast on the “arrow” div after user stops clicking the div is still sliding. I set the animate function under a small delay but I still experience
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.