标签:des blog io ar sp java strong on div
回调模式:
var findNodes = function (callback) { ...................... if (typeof callback !== ‘function‘) { callback = false; } ................ while(i) { i --; ............ if(callback) { callback(found) } ............ } }
var findNodes = function (callback, callback_obj) { ......... if(typeof callback === ‘string‘) { callback = callback_obj[callback]; } ........... if(typeof callback === ‘function‘) { callback.call(callnack_obj, found); } ........... }
//findNodes(‘paint‘, myapp);
标签:des blog io ar sp java strong on div
原文地址:http://www.cnblogs.com/jinkspeng/p/4152741.html