摘要:
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 = ... 阅读全文
摘要:
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... 阅读全文
摘要:
//根据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... 阅读全文
摘要:
function Queue() { this.data = []; } Queue.prototype = { processTime: 20, add: function (fn, params, context) { this.data.push({ fn: fn, params: params, context: context }); }, start: functio... 阅读全文