06 2011 档案

摘要:1. 下载地址:http://yuilibrary.com/downloads/#yuicompressor2.解压,如:放在E盘,注意使用的是jar文件,所以路径为:yuicompressor-2.4.6\build\yuicompressor-2.4.6.jar3.压缩同一目录下 test.js4.运行--cmd--e: 5.粘贴: java -jar yuicompressor-2.4.6\build\yuicompressor-2.4.6.jar --type js --charset UTF-8 test.js -o test-min.js6.完成,生成了新的压缩文件: test-m 阅读全文
posted @ 2011-06-27 19:12 Unintended 阅读(256) 评论(0) 推荐(0)
摘要:以前是通过监听document的onclick事件,获取当前对象的ID,如果不为要显示DIV的id,则关闭DIV。没下面这个好用:<!DOCTYPE html><html><head><meta charset="utf-8" /><title>点击其它地方关闭DIV</title></head><body><input type="text" value="" id="tf"/><div style= 阅读全文
posted @ 2011-06-11 16:05 Unintended 阅读(361) 评论(0) 推荐(0)
摘要:from:http://rockyee.iteye.com/blog/891538 1 Number.prototype.toFixed = function(scale){ 2 var s = this + ""; 3 if (!scale) scale = 0; 4 if (s.indexOf(".") == -1) s += "."; 5 s += new Array(scale + 1).join("0"); 6 if (new RegExp("^(-|\\+)?(\\d+(\\.\\d{0,&q 阅读全文
posted @ 2011-06-09 16:55 Unintended 阅读(373) 评论(0) 推荐(0)
摘要:【from:】http://hi.baidu.com/slandi/blog/item/98b14442f2fc77059313c6c9.html方式一,length赋值为0这种方式很有意思,其它语言如Java,其数组的length是只读的,不能被赋值。如int[]ary={1,2,3,4};ary.length=0;Java中会报错,编译通不过。而JS中则可以,且将数组清空了,如varary=[1,2,3,4];ary.length=0;console.log(ary);//输出[],空数组,即被清空了目前 Prototype中数组的clear方法和mootools库中数组的empty方法使 阅读全文
posted @ 2011-06-02 11:50 Unintended 阅读(386) 评论(0) 推荐(0)