JavaScript获取客户端IP
<!--JavaScript获取客户端IP-->
<script type="text/javascript" language="javascript">
<!--
function GetLocalIPAddress()
{
var obj = null;
var rslt = "";
try
{
obj = new ActiveXObject("rcbdyctl.Setting");
rslt = obj.GetIPAddress;
obj = null;
}
catch(e)
{
//异常发生
}
return rslt;
}
document.write("你的IP是:" + GetLocalIPAddress());
//-->
</script>
相关文档:
1、rcbdyctl
view plaincopy to clipboardprint?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=gb2312">
<title>JS获取客户端IP</title>
</head>
<b ......
经常在ie6下出现javascript页面跳转和表单提交问题,ie6下实现javascript页面跳转和表单提交需要进行特别处理,需要使用setTimeout()函数延迟实现。
1,兼容各浏览器的Javascript页面跳转
setTimeout(function(){
window.location.href = url;
},0);
2,兼容各浏览器的Javascript表单提交
setTimeout(function ......
早上在csdn上看有人问页面style sheet怎么修改里面的rule,就写了个类,该类对兼容FF和IE做了处理。
/**//*--------------------------------------------
描述 : 添加新的样式rule
参数 : styleSheets索引
代码 :&nb ......
转自:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>图片跑马灯</title>
</head>
<body>
<div style="overflow:hidden; width:350px" id='div'>
<!-- 这里是第一个关键点,o ......
(1)var recat = new RegExp("cat"); //简单定义。
var recat = new RegExp("cat","gi");//g->global,i->case insensitive.
var recat = /cat/gi;   ......