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

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">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<head>
<title>无限级树形菜单</title>
<mce:style><!--
#A1 td { vertical-align: top; }
#A1 td.bj { font-family: Wingdings; color: #FF9933; text-align: center; }
#A1 td.bj , #A1 td.kg { width: 24; }
#A1 a:link , #A1 a: visited { color: #cc0080; text-decoration: none; }
#A1 a:hover { color: #0ff080; text-decoration: none; }
--></mce:style><style mce_bogus="1">#A1 td { vertical-align: top; }
#A1 td.bj { font-family: Wingdings; color: #FF9933; text-align: center; }
#A1 td.bj , #A1 td.kg { width: 24; }
#A1 a:link , #A1 a: visited { color: #cc0080; text-decoration: none; }
#A1 a:hover { color: #0ff080; text-decoration: none; }</style>
<mce:script language="JavaScript"><!--
function m_start(name,tt) //菜单组开始
{
document.writeln('<tr><td class="bj">'+(tt==1?'1':'0')+'</td>');
document.writeln('<td><a href="#" mce_href="#" onclick="zgmm()">'+name+'</a></td>');
document.writeln('</tr>');
document.writeln('<tr style="display: '+(tt==1?'block':'none')+';" mce_style="display: '+(tt==1?'block':'none')+';">');
document.writeln('<td class="bj"> </td>');
document.writeln('<td>');
document.writeln('<table border="0" cellpadding="0" cellspacing="0">');
}
function m_end() //菜单组结束
{
document.writeln('</table></td></tr>');
}
function add_Sub(name,url,kj) //添加菜单项
{
document.writeln('<tr><td class="bj">2</td><td>');
document.writeln('<a target="'+kj+'" href="'+url+'" mce_href="'+url+'">'+name+'</a>');
document.writeln('</td></tr>');
}
functi


相关文档:

JavaScript性能优化之循环操作

JavaScript中有四种不同类型的循环,for循环、do-while循环和while循环。(第四种类型为for-in循环,用于迭代对象的属性,本文不予讨论。)代码如下:
var values = [1, 2, 3, 4, 5];
//for 循环
for(var i=0; i<values.length; i++){
process(values[i]);
}
//do-while 循环
var j=0;
do{
process(values[j++] ......

javascript面向对象编程

---->什么是类和对象
这是所有面向对象编程之前必须弄明白的.
所谓类:简单地说就是模板,说的专业一些,是一类具有某种性质的物的集合.比如:人就是一个类,车也是一个类,等等.
所谓对象:就是类的具体实现.如上面所说,人是一个类,一个具体的人就是一个对象,比如张三.

对象是类的实例化后的结果.ja ......

IE与Firefox下javascript getyear年份的兼容性写法

                    前几天在测试网站兼容性问题,发现原来在IE下面正常的显示时间在Firefox获取年份下显示109
                &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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>javascript</t ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号