11th,八月,2010

正则表达式验证字符串组成

<script type=”text/javascript”>
function check_str(){
var str = document.getElementById(“str”).value;
var check_letters = /^[a-zA-Z]+$/.test(str);//判断字符串由字母组成
var check_numbers = /^[0-9]+$/.test[......]

继续阅读

10th,八月,2010

打算重新写个blog的皮肤

发现wordpress升级后,皮肤代码渐渐出现了问题,打算重新写个blog皮肤,要很简洁,看了明城同学的blog,很是舒服啊,打算学习这种简洁的风格。

10th,八月,2010

wordpress模板函数

一套完整的WordPress模板应至少具有如下文件:

style.css : CSS(样式表)文件
index.php : 主页模板
archive.php : Archive/Category模板
404.php : Not Found 错误页模板
comments.php : 留言/回复模板
footer.php : Footer模板
header.php : Header模板
sideba[......]

继续阅读

6th,八月,2010

YUI event事件

YUI的Event包可以用来操纵DOM事件,也可以自定义事件。
1. 要使用Event,首先要引入YUI3的种子文件:
<script src=”http://yui.yahooapis.com/3.0.0/build/yui/yui-min.js”></script>

然后加载相应模块:

YUI().use(‘event’, function(Y) {
});

2. 设[......]

继续阅读

30th,七月,2010

json eval()函数优化

var morik={};
morik.eval=function(s){
if(navigator.userAgent.toLowerCase().indexOf(“msie”) > -1)
return eval(s);
else{
var aa=new Function( “return”+s);
return aa.apply(this[......]

继续阅读