SoFunction
Updated on 2025-04-12

JavaScript gets the code of the current ip


<script language="JavaScript">
function GetLocalIPAddr(){
var oSetting = null;
var ip = null;
try{
oSetting = new ActiveXObject("");
ip = ;
alert(ip);
if ( == 0){
return "Not connected to the Internet";
}
oSetting = null;
}catch(e){
return ip;
}
return ip;
}
alert(GetLocalIPAddr())
</script>