易截截图软件、单文件、免安装、纯绿色、仅160KB

JavaScript 生成 table

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>test</title>
<mce:style type="text/css"><!--
.table_back{width:480px;height:480px;border-bottom:1px solid black;border-right:1px solid black;}
.floor{border-left:1px solid black;border-top:1px solid black;font-size:1px;}

--></mce:style><style type="text/css" mce_bogus="1"> .table_back{width:480px;height:480px;border-bottom:1px solid black;border-right:1px solid black;}
.floor{border-left:1px solid black;border-top:1px solid black;font-size:1px;}
</style>
</head>
<body>
<a href="javascript:init(11);" mce_href="javascript:init(11);">test</a>
<mce:script type="text/javascript"><!--
function init(data) {
var self = this;
this.rowCount = self.rowCount || 20;
this.colCount = self.colCount || 20;
this.parent1 = self.parent1 || document.body; // ??
this.table_back = document.createElement("table");
this.table_back.className = 'table_back';


for (var i = 0; i < this.rowCount; i++) {
var tr = this.table_back.insertRow(-1);
for (var j = 0; j < this.colCount; j++) {
var td = tr.insertCell(-1);
td.className = "floor";
td.innerHTML = "&nbsp;";

}
}

this.parent1.appendChild(this.table_back);
}

// --></mce:script>
</body>
</html>


相关文档:

[JAVASCRIPT] this 对象

看了很多javascrip代码,发现很多地方用到了this这个对象,那这个到底是什么东西阿?
先让我们来理解一个概念:
在javascript会有一个上下文的概念,任何一个对象无论是Object 还是function 都会有一个专有的上下文对象,也可以理解为它自己的拥有者。
那么我们很容易想到这个拥有者,必然有个终点,那就是window对象。 ......

JavaScript 鼠标拖拽进行快速产品分类效果

代码示例
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<mce:style><!--
.man{ float:left; background:#9af; margin:3px; padding:3px; cursor:default}
--></mce:style>< ......

Javascript 密码强度设置 脚本

/**
 * 6 级强度设置(数字、大写字母、小写字母、特殊字符、长度>=6、长度>=10)
 * 如果密码为空,返回 0
 */
function __pwdStrength(pwd) {
    var sum = [0, 0, 0, 0];
    for (var i=0; i<pwd.length; i++) {
      & ......

JavaScript正则表达式

JS的正则表达式
//校验是否全由数字组成
function isDigit(s)
{
var patrn=/^[0-9]{1,20}$/;
if (!patrn.exec(s)) return false
return true
}
//校验登录名:只能输入5-20个以字母开头、可带数字、“_”、“.”的字串
Java代码
function isRegisterUserName(s)   
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号