How do I detect the IP address of the viewer when he/she is trying to access my page?

Rama V

You can't do this from JavaScript, but if your server supports JSP, you can use the 'request' object to get this information.
Sample code:
write this code in the beginning of your jsp
<% String ip = request.getRemoteAddr(); %>
You can assign this to a JavaScript variable like var str = "<%=ip%>"