function f(a,b,c){ console.log(a,b,c);} f.apply(null,{0:123,1:456,2:789,length:2});//123 456 undefined ,因为 length 属性值为2,值只传入了 2 个参数 f.apply(null,{10:123,11:456,12:789,length:3});// undefined undefined undefined , 因为参数对象不存在以 0、1、2 为...
阅读:231
评论:0
function print_r(array, return_val) { var output = '', pad_char = ' ', pad_val = 4, d = this.window.document, getFuncName = function (fn) { var name = (/\W*function\s+([\w\$]+)\s*\(/).exec(fn); if (!name) { return '(Anonymous)'; } return name[1]; }, repeat_char = function (len, pad_char) { var str = ''; for (var i = 0; i < len; i++)...
阅读:131
评论:0
function querystring(){ this.params = new Object(); this.initialize = function(){ var param=this.paramstring(); if(param.length == 0) return; if(param.substring(0,1)=='?'){ param=param.substring(1); } param = param.replace(/\+/g, ' '); var args = param.split('&'); for (var i=0;i<a...
阅读:925
评论:0
/** Powered By CMSDream Copyright © 2007-2008 All rights reserved. 14:21 2008-5-10 **/ function CMSDreamAjaxLib(){ /**//** 成员变量 */ this.XMLHttpReq = null; //XML对象 this.method = "post"; //执行的方法(post/get) this.url = ""; //异步调用的页面地址 this.responseText = ""; //异步返回的响应字符串 this.responseXML = ""; //异步返回的响应XM...
阅读:116
评论:0
function AttachStyle(styDom, styCss, styId){ var istyle = styDom.createElement('style'); istyle.setAttribute("type", "text/css"); if(styId!=null){if(!document.getElementById(styId)){istyle.setAttribute("id", styId);}} if (istyle.styleSheet){ istyle.styleSheet.cssText=styC...
阅读:210
评论:0
/** Powered By CMSDream Copyright © 2007-2008 All rights reserved. 15:10 2008-6-7 **/ function querystring(paramstring){ this.url=window.location.href; this.params = new Object(); this.initialize = function(){ if(paramstring.length == 0) return; if(paramstring.substring(0,1)=='?'){ paramstring=paramstring.substring(1); } paramstring = p...
阅读:172
评论:0
function strLen(str){ var len=0; for(var i=0;i<str.length;i++){ var intCode=str.charCodeAt(i); if(intCode>=0 && intCode<=128){ len = len + 1; }else{ len = len + 2; } } return len; }
Private Function Length(iTxt) Dim txt: txt = Trim(iTxt) Dim x: x = Len(txt) ...
阅读:220
评论:0