12 2011 档案

摘要:全局变量?普通的:var sortList=(function(){})(); 文艺的:window.sortList=(function(){})(); this.sortList=(function(){})()xxx的:sortList=(function(){})(); 阅读全文
posted @ 2011-12-18 19:56 邪恶梦想
摘要:JavaScript 中,具名函数可以使用上述的方法直接调用,匿名函数可以通 过引用变量调用, 但没有引用的匿名函数怎么调用呢?下面的例子说明这三 种 情况:// 示例 1. 具名函数直接调用 function foo() {}foo();// 示例 2. 匿名函数通过引用来调用 fooRef = function() {}fooRef();// 示例 3. 没有引用的匿名函数的调用方法(1) (function() {// ... }());// 示例 4. 没有引用的匿名函数的调用方法(2) (function() {// ... })();// 示例 5. 没有引用的匿名函数的调用方法( 阅读全文
posted @ 2011-12-18 19:44 邪恶梦想
摘要:var scripts = document.getElementsByTagName("script");for (var i = 0; i < scripts.length; i++) { var url = scripts[i].src; // extract filename and callback parameter from the URL var matches = url.match(/\/([^\/]+)\?.*v=(.*?)(&|$)/); if (matches && matches[1] == "test.j 阅读全文
posted @ 2011-12-12 09:34 邪恶梦想
摘要:http://itunes.apple.com/pt/podcast/node-tuts/id414004165 阅读全文
posted @ 2011-12-06 09:41 邪恶梦想
摘要:var wh = {};"fo_dlg_3 fo_dlg_4".replace(/[^ ]+/g,function(a){ var elem = document.getElementById(a); wh[a] = {}; 'Width Height'.replace(/[^ ]+/g, function(i){ wh[a][i] = elem['offset' + i] || elem['client' + i]; });});console.log(wh); 阅读全文
posted @ 2011-12-05 10:35 邪恶梦想
摘要:$ sudo apt-get update$ sudo apt-get install git-core$ sudo apt-get install build-essential openssl libssl-dev$ git clone https://github.com/joyent/node.git && cd node$ ./configure$ make$ sudo make install$ git checkout v0.6.0$ ./configure$ make$ sudo make install$ node -v$ sudo apt-get insta 阅读全文
posted @ 2011-12-04 20:57 邪恶梦想 阅读(520) 评论(0) 推荐(0)