JavaScript树
/** 配置参数 */
function TreeConfig() {
this.showIco = true;
this.showCheckBox = false;
this.checkBoxName = "_TREE_CHECKBOX_";
this.checkBoxRelated = false;
}
/**
* 节点类
* 节点目前默认支持的属性有:
* text, url, target, cb, cbname, cbchecked, cbval, ico, icoFile, icoOpen
*/
function Node(id, parentId, attributes) {
this.id = id; // 节点自身id
this.parent = parentId || ""; // 父id
this.attributes = attributes || {}; // 节点属性
this._created = false;
this._expanded = false;
this._checked = false;
}
// 得到节点属性
Node.prototype.getAttribute = function(key) {
var attr = this.attributes[key];
return (attr==undefined || attr=="")? null : attr;
}
// 得到节点属性
Node.prototype.setAttribute = function(key, value) {
this.attributes[key] = value;
}
/** 树类 */
function TissonTree(instanceName, config) {
this.instanceName = instanceName || "tree"; // 实例名
this.nodes = {}; // 所有节点集
this.nodeArray = null; // 包含所有节点的数组
this.nodeLink = {}; // 父-子节点对应关系集
this.rootId = "-1"; // 默认根节点id
this._baseImagesPath = "/SmtCCS_tkms/images/tree/"; // 图片的基本路径
this._checkedNodes = {};
this.selectedNode = null;
this.selectedNodeId = "";
this.nextSearchIndex = 0;
this.searchText = "";
this.treeStage = null;
&
相关文档:
javascript中存在几种对URL字符串进行编码的方法:escape(),encodeURI(),以及encodeURIComponent()。这几种编码所起的作用各不相同。
escape() 方法:
采用ISO Latin字符集对指定的字符串进行编码。所有的空格符、标点符号、特殊字符以及其他非ASCII字符都将被转化成%xx格式的字符编码(xx等于该字符在字符集表 ......
javascript:基础知识
1 创建脚本块
1: <script language=”javascript”>
2: javascript code goes here
3: </script>
2 隐藏脚本代码
1: <script language=”javascript”>
2: <!--
3: document.write(“Hello”);
4: // -->
5: </script>
在 ......
表单的验证在实际的开发当中是件很烦琐又无趣的事情
今天在做一个小项目的时候,需要JS验证,寻找到一个比较好的东西
地址如下:
http://blog.csdn.net/goodfunman/archive/2005/10/21/513338.aspx
http://blog.csdn.net/yhl_621/archive/2006/03/04/615273.aspx
http://blog.csdn.net/NetDreamwing/archive/2004/1 ......
今天的话题是如何改进自己网站的界面或提高网站的视觉体验,从而让用户记忆犹新。
我们有三种主要的方法(从难到易):自己动手写脚本;使用类似于jQuery和mooTools的JavaScript框架(可以让编写代码变得更容易些);使用能工作于现有的JavaScript框架下的提前预置好的脚本或那种从头开始开发的创建者。这篇文章适合那 ......