PHP手册
[英文][中文]
MYSQL 5.1手册
http://dev.mysql.com/doc/refman/5.1/zh
HTML在线教程
http://www.w3school.com.cn/h.asp
XML在线教程
http://www.w3school.com.cn/x.asp
jQuery 1.3API手册
http://feiyu.asgard.cn/books/jQuery1.3_API/index.html
PHP 编程标准
http://www.phpe.net/html/php_coding_standard_cn.html
<script language=”javascript“>
<!–
function cleanWordHtml(html){
// Remove all SPAN tags
html = html.replace(/</?SPAN[^>]*>/gi, “”);
// Remove Class attributes
html = html.replace(/<(w[^>]*) class=([^ |>]*)([^>]*)/gi, “<$1$3″) ;
// Remove Style attributes
html = html.replace(/<(w[^>]*) style=”([^"]*)”([^>]*)/gi, “<$1$3″) ;
// Remove Lang attributes
html = html.replace(/<(w[^>]*) lang=([^ |>]*)([^>]*)/gi, “<$1$3″) ;
// Remove XML elements and declarations
html = html.replace(/<\??xml[^>]*>/gi, “”) ;
// Remove Tags with XML namespace declarations: <o:p></o:p>
html = html.replace(/</?w+:[^>]*>/gi, “”) ;
// Replace the
html = html.replace(/ /, ” ” );
// Transform <P> to <DIV>
var re = new RegExp(“(<P)([^>]*>.*?)(</P>)”,”gi”) ;
// Different because of a IE 5.0 error
html = html.replace( re, “<div$2</div>”);return html;
}
//–>
</script>
以下所有代码全是在<head>…</head>之间,具体内容有:
1,<title>…</title>
标题元素,帮助用户更好识别文件,有且只有一个。当作为首页或收藏时做文件名。
2,<link>…</link>
显示本文档和其它文档之间的关系:<link rel=“stylesheet” href=“s.css”> 和外部样式表的连接。
rel说明html文件和url两文档之间的关系,href说明文档名。
3,<style>…</style>
可以在文档中包含风格页。文档本身的内部样式。
4,<base>…</base>
为相对路径定义绝对路径url,读者下载你的文档后,也可知道从哪下的
url格式:通信协议://主机名/路径/文件名
5,<script>…</script>
用于包含脚本(一系列脚本语言写的命令)可以是 javascript 或 VbScript。
6,<meta>…</meta>
meta标签的常见功能:
1、帮助主页被各大搜索引擎登录
2、定义页面的使用语言
3、自动刷新并指向新的页面
4、实现网页转换时的动画效果
5、网页定级评价
6、控制页面缓冲
7、控制网页显示的窗口。
meta是用来在HTML文档中模拟HTTP协议的响应头报文。
meta 的属性有两种:name和http-equiv。
name 属性主要用于描述网页,对应于content(网页内容),以便于搜索引擎机器人查找、分类(目前几乎所有的搜索引擎都使用网上机器人自动查找meta值来给网页分类)。这其中最重要的是description(站点在搜索引擎上的描述)和keywords(分类关键词),所以应该给每页加一个meta 值。
name 属性
1、<meta name=”Generator” contect=”editplus”>用以说明生成工具(如Microsoft FrontPage 4.0)等;
2、<meta name=”KEYWords” contect=”cnbruce,cnrose”>向搜索引擎说明你的网页的关键词;
3、<meta name=”Description” contect=”cnbruce’s blog”>告诉搜索引擎你的站点的主要内容;
4、<meta name=”Author” contect=”cnbruce”>告诉搜索引擎你的站点的制作的作者;
5、<meta name=”Robots” contect=”all|none|index|noindex|follow|nofollow”>
其中的属性说明如下:
设定为all:文件将被检索,且页面上的链接可以被查询;
设定为none:文件将不被检索,且页面上的链接不可以被查询;
设定为index:文件将被检索;
设定为follow:页面上的链接可以被查询;
设定为noindex:文件将不被检索,但页面上的链接可以被查询;
设定为nofollow:文件将不被检索,页面上的链接可以被查询。
http-equiv属性
1、<meta http-equiv= “Content-Type”contect=”text/html”;charset=gb_2312-80″>和 <meta http-equiv=”Content-Language” contect=”zh-CN”>用以说明主页制作所使用的文字以及语言;又如英文是ISO-8859-1字符集,还有BIG5、utf-8、 shift-Jis、Euc、Koi8-2等字符集;
2、<meta http-equiv=”Refresh” content=”n; url= yourlink”>;
定时让网页在指定的时间n秒内,跳转到页面http://yourlink;
3、<meta http-equiv=”Expires” contect=”Mon,12 May 2001 00:20:00 GMT”>可以用于设定网页的到期时间,一旦过期则必须到服务器上重新调用。需要注意的是必须使用GMT时间格式;
4、<meta http-equiv=”Pragma” contect=”no-cache”>是用于设定禁止浏览器从本地机的缓存中调阅页面内容,设定后一旦离开网页就无法从Cache中再调出;
5、<meta http-equiv=”set-cookie” contect=”Mon,12 May 2004 00:20:00 GMT”>cookie设定,如果网页过期,存盘的cookie将被删除。需要注意的也是必须使用GMT时间格式;
6、<meta http-equiv=”Pics-label” contect=”">网页等级评定,在IE的internet选项中有一项内容设置,可以防止浏览一些受限制的网站,而网站的限制级别就是通过meta属性来设置的;
7、<meta http-equiv=”windows-Target” contect=”_top”>强制页面在当前窗口中以独立页面显示,可以防止自己的网页被别人当作一个frame页调用;
8、<meta http-equiv=”Page-Enter” contect=”revealTrans(duration=1.0,transtion= 12)”>
、<meta http-equiv=”Page-Exit” contect=”revealTrans(duration=1.0,transtion= 12)”>
设定进入和离开页面时的特殊效果,这个功能即FrontPage中的“格式/网页过渡”,不过所加的页面不能够是一个frame页面。
Duration的值为网页动态过渡的时间,单位为秒。
Transition是过渡方式,它的值为0到23,分别对应24种过渡方式。如下表:
0 盒状收缩
1 盒状放射
2 圆形收缩
3 圆形放射
4 由下往上
5 由上往下
6 从左至右
7 从右至左
8 垂直百叶窗
9 水平百叶窗
10 水平格状百叶窗
11垂直格状百叶窗
12 随意溶解
13从左右两端向中间展开
14从中间向左右两端展开
15从上下两端向中间展开
16从中间向上下两端展开
17 从右上角向左下角展开
18 从右下角向左上角展开
19 从左上角向右下角展开
20 从左下角向右上角展开
21 水平线状展开
22 垂直线状展开
23 随机产生一种过渡方式
给textarea增加长度的限制
我们知道文本框可以有一个为maxlength的属性,可以限制文本框的长度,当时备注框textarea却没有,那么
要怎样限制备注框的长度呢?其实很简单,只有加上想这样一句话onKeyDown=””if (this.value.length>=20){event.returnValue=false}””
就可以了,h|Xb`=Puea:k.整个写法如下:
<textarea name=”A” cols=”45″ rows=”2″ onKeyDown=””if (this.value.length>=20){event.returnValue=false}””>aaaa</textarea>
我们也可以将判断写在函数中,=xM’n(S0S的h:`如果输入的长度超过显示,就显示提示信息,如下:
<html>
<body>
<form name = “testform”>
<textarea name=”A” cols=”45″ rows=”2″ >aaaa</textarea>
<input type=”button” onclick = “checkValid()” value= “提交”>
</form>
</body>
</html>
<script language=”javascript”>
function checkValid()
{
var a = document.testform.A;
if(a.value.length > 20)
{
alert(“输入的备注框长度不能超过20个字符!”);
return false;
}
return true;
}
</script>