我在 extjs 工作。我想找到IP地址。我有 javascript 代码来获取 ipaddress as-
<script language="JavaScript">
VIH_BackColor = "palegreen";
VIH_ForeColor = "navy";
VIH_FontPix = "16";
//VIH_DisplayFormat = "You are visiting from:<br>IP Address1: %%IP%%<br>Host1: %%HOST%%";
// Code for only getting ip address
VIH_DisplayFormat = "%%IP%%";
VIH_DisplayOnPage = "yes";
</script>
<script language="JavaScript" src="http://scripts.hashemian.com/js/visitorIPHOST.js.php"></script>
<script language="JavaScript">
//alert(VIH_DisplayFormat);
if(VIH_DisplayFormat!="121.246.216.1181")
{
alert("you are not authorized user");
}
else
{
alert(VIH_DisplayFormat);
}
</script>
</HEAD>
那么如何修改这段代码以在 extjs 中工作。或者在 extjs 中有没有其他方法来计算 ipaddress?