20th,五月,2010

IE与FF实现纯英文纯数字字符自动换行

IE css code:

#test{
width:135px;
table-layout:fixed;
word-break: break-all;//只对IE浏览器有效
overflow:hidden;
}

FF js code:

<!Doctype html>
<html>
<body>
<div  id=”test” style=[......]

继续阅读

18th,五月,2010

推荐jquery vs yui3网址 http://carlos.bueno.org/jq-yui.html

强烈推荐jquery vs yui3,看看他们之间的语法的相似差异,觉得能对学习YUI3提供一些帮助

http://carlos.bueno.org/jq-yui.html

17th,五月,2010

参数数值 替换 replace

url:

http://www.taobao.com/go/act/shopping/sousuo55660.php?pid=mm_88888888_0_0&unid=123

js code:

<script type=”text/javascript”>
(function(){
var isrun = false;
var init_pid = function(){[......]

继续阅读

13th,五月,2010

json格式

Json的规格非常简单,只用一个页面、几百个字就能说清楚,而且Douglas Crockford声称这个规格永远不必升级,因为该规定的都规定了。

1) 并列的数据之间用逗号(”,”)分隔。
2) 映射用冒号(”:”)表示。
3) 并列数据的集合(数组)用方括号(“[]“)表示。
4) 映射的集合(对象)用大括号(”{}”)表示。

上面四条规则,就是Json格式的[......]

继续阅读

11th,五月,2010

YUI3 Node.simulate()模拟鼠标事件

触发事件,类似于mootools的fireEvent()方法

YUI().use('node-event-simulate', function(Y) {
 Y.one("#test").simulate("click", { shiftKey: true });
});