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
相关文档:
//总记录数
function sumRecord()
{
var conn= Server.CreateObject("ADODB.connection");
var rs= Server.CreateObject("adodb.recordset");
conn.open("PROVIDER=SQLOLEDB;DATA SOURCE=127.0.0.1;UID=sa;PWD=123456;DATABASE=test");
var sql = "select count(*) as RecordCount from baoming";
rs.open(sql, ......
文章分类:
JavaScript
文章标题:
javascript 字符串处理全攻略
关 键 字:
0
文章作者:
alonglee
文章来源:
http://lmgq.vip.sina.com/tech/jsadvancedlesson/c2p1.htm
发表时间:
2004-9-21 14:43:00
一、声明字符串:
var normal_monkey = "I&n ......
http://code.google.com/p/update-javascript-trim/
常见的写法为:
function trim(s){
return s.replace(/^\s+|\s+$/g, '');
}
优化后trim函数的代码如下:
function trim(str) {
str = str.replace(/^\s+/g, '');
for(var i = str.length - 1; i >= 0; i--){
if(!/^\s$/.test(str.substr(i,1) ......
1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)> <td>no </table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy ......
<!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 ......