随笔分类 - JavaScript
摘要:十进制转换二进制: 1 var c= 0,i = 10,k; 2 var g = new Array(); 3 4 while(i!=0) { 5 k = i%2; 6 if(k != 0) { 7 i = i-k; 8 } 9 g.unshift(k);10 i=i/2;11 }12 13 for(var kk in g) {14 document.write(g[kk])15 }二进制转换十进制: 1 var num = ...
阅读全文
摘要:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head> <meta http-equiv="Content-Type" content=&quo
阅读全文
摘要:代码1:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><head> <meta http-equiv="Content-Type" content=
阅读全文
摘要:Function.apply and Function.call in JavaScriptIn order to explain how the createDelegate function works in the last post, we have to understand JavaScript closures and Function.apply(). The apply() method is the easiest subject to tackle, so we'll start there and work up.Every function in JavaSc
阅读全文
浙公网安备 33010602011771号