Here is a demo of
a Javascript designed to get the current IP address. A key element of the algorithm is that it makes a
synchronous XMLHttpRequest to a
server php script, i.e. ip = getIP(); does not return until the server has provided the answer.
Here is a sample of the script in action:
It is also a useful basis for a method of
avoiding those pesky accidental invalid clicks.