- node.js
- Installation paths: use one of these techniques to install node and npm without having to sudo.
- Node.js HOWTO: Install Node+NPM as user (not root) under Unix OSes
- Felix's Node.js Guide
- Creating a REST API using Node.js, Express, and MongoDB
- Node Cellar Sample Application with Backbone.js, Twitter Bootstrap, Node.js, Express, and MongoDB
- JavaScript Event Loop
- Node.js for PHP programmers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
var cache = {}; | |
this.tmpl = function(str, data) { | |
cache[str] = cache[str] || | |
new Function('data', [ | |
'var _p="";\nwith(arguments[0]||{}){\n_p+="', | |
str.replace(/"/g, '\\$&') | |
.replace(/[\r\n]/g, '') | |
.replace(/<%([^\w\s\}\)]*)\s*(.*?)\s*%>/g, function(match, mark, code) { | |
if (mark === '=') return '"+(' + code + ')+"'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//调取负责人ajax | |
$(".c_fuze").click(function(e) { | |
//$("#add_fuzeren").empty(); | |
if ($("#add_fuzeren").html() == "" || 1 == 1) { | |
geta($("#add_fuzeren"), '/Works/plus/act/fuze', loadGif); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addEvent(el, type, handler) { | |
if (el.attachEvent) { // IE | |
// 为元素的事件类型创建一个哈希表 | |
el._events = el._events || {}; | |
if (!handler) { | |
return; | |
} | |
// 取得事件处理函数的数组的引用 | |
var handlers = el._events[type]; | |
if (handlers) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Cross Browser helper to addEventListener. | |
* | |
* @param {HTMLElement} obj The Element to attach event to. | |
* @param {string} evt The event that will trigger the binded function. | |
* @param {function(event)} fnc The function to bind to the element. | |
* @return {boolean} true if it was successfuly binded. | |
*/ | |
var cb_addEventListener = function(obj, evt, fnc) { | |
// W3C model |