易截截图软件、单文件、免安装、纯绿色、仅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动态调整图片尺寸

在自己的网站上更新文章时一个比较常见的问题是:文章插图太宽,使整个网页都变形了。如果对每个插图都先进行缩放再插入的话,太麻烦了。
我前段时间写的一篇文章就遇到过这种事情,后来用CSS的overflow和max-width属性暂时解决了页面变形的问题。这种方法好处是简单,但坏处是会破坏某些细节的效果。
如overflow:hidden ......

javascript中的null和undefined

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

JavaScript贪吃蛇

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>贪食蛇</title></head>
<body>
<mce:style type="text/css"><!--
.tab ......

JavaScript判断浏览器类型及版本

      通过分析各类浏览器的userAgent信息,不难得出分辨各类浏览器及其版本的正则表达式。而且,对浏览器类型的判断和版本的判断完全可以合为一体地进行。于是,我们可以写出下面的代码:
    <script type="text/javascript">
       ......

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号