Cómo obtener la IP del visitante a través de JS
lt; @ page language="java" import="java.util.*" pageEncoding="gb2312"gt
lt
Ruta de cadena = request.getContextPath(); /p>
Cadena basePath = request.getScheme() "://" request.getServerName() ":" request.getServerPort() ruta "/"
gt ;
lt DOCTYPE HTML PUBLIC "-//W3C/DTD HTML 4.01 Transicional/EN"gt
lt htmlgt;
lt;/headgt;
lt; tipo de script="text/javascript" src="js/jquery/jquery-1.8.1.min.js"gt; lt;/scriptgt;
lt;bodygt;
lt;/bodygt;
lt;! -- Consultar la IP local a través de hashemian.com --gt;
lt; script type="text/javascript" src="/js/visitorIPHOST.js.php"gt; p > lt;/scriptgt;
lt;script type="text/javascript"gt;
var datos = $("td:parent")[0].lastChild. datos ;
var ip = data.substring(6, data.length
alerta(ip);/scriptgt; >
lt;/htmlgt;