下拉框树,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) {
相关文档:
HTML 是 Web 统一语言,这些容纳在尖括号里的简单标签,构成了如今的 Web。1991 年,Tim Berners-Lee 编写了一份叫做 “HTML 标签”的文档,里面包含了大约20个用来标记网页的 HTML 标签。他直接借用 SGML 的标记格式,也就是后来我们看到的 HTML 标记的格式。本文讲述了 HTML 这门 Web 标记语言的发展简史。
......
因为Wap2.0使用XHTML语言并兼容WML,以下是网上找的XHTML和HTML的区别
XHTML相比于HTML
1.所有的标记都必须要有一个相应的结束标记
以前在HTML中,你可以打开许多标签,例如和<li>而不一定写对应的
和</li>来关闭它们。但在XHTML中这是不合法的。XHTML要求有严谨的结构,所有标签必须 ......
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=gb2312" http-equiv="Content-Type" />
<title>简单的测试页面</title> ......
XML和HTML常用转义字符
XML和HTML中都有一些特殊的字符,这些字符在XML和HTML中是不能直接使用的,如果必须使用这些字符,应该使用其对应的转义字符。
如果在XML文档中使用类似"<" 的字符, 那么解析器将会出现错误,因为解析器会认为这是一个新元素的开始。
所以不应该像下面那样书写代码:
<message&g ......
原文地址:http://www.php-oa.com/2009/09/24/perl-html-tree-builder-xpath.html
转过来 慢慢研究
强大的Perl中,有超级多强大的模块,让我们不在需要重复的发明轮子.下面这个就是一个强大的模块.HTML::TreeBuilder::XPath.它能象xml一样解析网站.怎么使用就不细讲了,如下,见实例,我是从alexa.com网站得到我的网站排名的一 ......