易截截图软件、单文件、免安装、纯绿色、仅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中的null和undefined

javascript中的null和undefined
本文装载网络,版权归原作者所有。
null :表示无值;
undefined : 表示一个未声明的变量,
                或已声明但没有赋值的变量,
          &nb ......

javascript 运行机制

以下全是个人理解以及网上查找而来,如有不对请指正...
假如有n段js代码 用<script>标签隔开的.
运行顺序是
step1. 读入第一个代码段
step2. 做语法分析,有错则报语法错误(比如括号不匹配等),并跳转到step5
step3. 对var变量和function定义做“预解析”(永远不会报错的,因为只解析正确的声明)
......

Javascript 密码强度设置 脚本

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

Javascript实现日期时间的倒计时

<html>
<body>
<SCRIPT type="text/javascript">
<!--
var target=[]
var time_id=[]
function ShowDateTime(){
    setTimeout("ShowDateTime()", 1000);
for (var i=0,j=target.length;i<j;i++)
{
    var today=new Date();
    timeo ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号