摘要: example.appcache文件中CACHE MANIFEST#2013-12-11test.jstest2.js在apache中AddType text/cache-manifest .appcache 阅读全文
posted @ 2013-12-11 20:26 sexy_girl 阅读(435) 评论(0) 推荐(0) 编辑
摘要: File API Example Select a file below. File API Example 阅读全文
posted @ 2013-12-11 18:00 sexy_girl 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2013-12-11 17:57 sexy_girl 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Drop some files hereupload.php$f = $_FILES['file0'];var_dump($f); 阅读全文
posted @ 2013-12-11 17:56 sexy_girl 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 在work.html中var data = [1,2,3,4], worker = new Worker('work1.js'); worker.onmessage = function(e){ var data = e.data; console.log('sorted:' + data); } worker.postMessage(data);在work1.js中self.onmessage = function(e){ var data = e.data; data.sort(function(a,b){ ... 阅读全文
posted @ 2013-12-11 17:08 sexy_girl 阅读(166) 评论(0) 推荐(0) 编辑
摘要: window.onload = function () { setTimeout(function () { var pfm = namespace.Performance; }, 300);} 阅读全文
posted @ 2013-12-11 16:29 sexy_girl 阅读(103) 评论(0) 推荐(0) 编辑
摘要: var changeTab =( function () { var timeId = 0; return function (tabId) { if (timeId) { clearTimeout(timeId); timeId = 0; } timeId = setTimeout(function () { //ajax do something }, 500); }; ... 阅读全文
posted @ 2013-12-11 13:24 sexy_girl 阅读(153) 评论(0) 推荐(0) 编辑
摘要: ajax.request("ajax.html",{v:Math.random(),num:1},function(data){ //do something},'get');var ajax = {//Xmlhttprequest类 Xmlhttprequest: function () { this.xhr = false; },//外部调用接口 request: function (url, data, callback, type) {//每次都创建一个Xmlhttprequest的对象,使ajax调用互不影响 var xhr = ... 阅读全文
posted @ 2013-12-11 12:25 sexy_girl 阅读(254) 评论(0) 推荐(0) 编辑
摘要: var $ = function (id) { return document.getElementById(id); } //返回dom元素的当前某css值 var getCss = function (obj, name) { //ie if (obj.currentStyle) { return obj.currentStyle[name]; } //ff else { var style = document.defaultView.get... 阅读全文
posted @ 2013-12-11 11:50 sexy_girl 阅读(566) 评论(0) 推荐(0) 编辑
摘要: //根据ID返回dom元素 2 var $ = function(id){return document.getElementById(id);} 3 //返回dom元素的当前某css值 4 var getCss = function(obj,name){ 5 //ie 6 if(obj.currentStyle) { 7 return obj.currentStyle[name]; 8 } 9 //ff10 else {11 var s... 阅读全文
posted @ 2013-12-11 11:38 sexy_girl 阅读(156) 评论(0) 推荐(0) 编辑
摘要: function Queue() { this.data = []; } Queue.prototype = { processTime: 20, add: function (fn, params, context) { this.data.push({ fn: fn, params: params, context: context }); }, start: functio... 阅读全文
posted @ 2013-12-11 11:31 sexy_girl 阅读(145) 评论(0) 推荐(0) 编辑