下拉框树,HTML代码
很多时候,我们需要将下拉框里面的数据用树显示出来,这样会便于客户得到清晰的数据,而且比较直接,晾出以下HTML代码,可以直接复制到HTML代码里面运行!
<!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></title>
<script>
/*****************************************
auth: polarbear
data: 2009.04.17
******************************************/
//ucstar select
//id: select id
//name: select attribute name
//rootSelectname: select first option value
//sign: iterator options's prefix sign
//selectid: about the selected option id
function UcstarSelectObj(id,name,rootSelectname,sign,selectedid) {
this.id = id;
this.name = name;
this.rootSelectname = rootSelectname;
this.sign = sign;
this.selectedid = selectedid;
this.selectStr = "";
this.ucstaroptions = [];
this.ucstaroptionobjs = [];
}
//ucstar option
//id: option id
//name: option value
//pid: the node's parent id
//desc: the option's description
function UcstarOption(id,name,pid,desc) {
this.id = id;
this.name = name;
this.pid = pid;
this.desc = desc;
}
//get the options by parentid
UcstarSelectObj.prototype.getChildOptions = function(vPid) {
var childOptions = new Array();
//this.debug(this.ucstaroptions.length);
for(var i = 0; i < this.ucstaroptions.length; i++) {
if(this.ucstaroptions[i].pid == vPid) {
//this.debug(this.ucstaroptions[i].pid + "-" + this.ucstaroptions[i].id);
childOptions[childOptions.length] = this.ucstaroptions[i];
}
}
return childOptions;
}
//debug message
UcstarSelectObj.prototype.debug = function(message) {
相关文档:
如何有一个字符串是这样的形式str = "&bbbLAA";
想得到"L"的话可以这样去实现:
//sDataStr = "&bbbLAA";
//sLeftQuote = ""&bbb";
//sRightQuote = "&AA";
调用这个方法将得到L字段。
function abCutString( sDataStr, sLeftQuote, sRightQuote)
{
var sReturnVal = '';
var nStart ......
双引号:"或"
单引号:'或'(IE实体名无效)
&符号:&或&
<小于:<或<
>大于:>或>
空格: 或 
£英磅:£或£
¥元:¥或¥
¦分隔符:¦或& ......
<!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> new docu ......
XML和HTML常用转义字符
XML和HTML中都有一些特殊的字符,这些字符在XML和HTML中是不能直接使用的,如果必须使用这些字符,应该使用其对应的转义字符。
如果在XML文档中使用类似"<" 的字符, 那么解析器将会出现错误,因为解析器会认为这是一个新元素的开始。
所以不应该像下面那样书写代码:
<message&g ......
凸线边框(宽度10,红色)
分组框 代码
<fieldset style="border:10px ridge #FF0000; padding:2px; width:500">
<legend>分组框</legend>
</fieldset>
凹线
分组框 代码
<fieldset style="border:10px groove #FF0000; padding:2px; width:500">
<legend>分组框</legen ......