Rico 模块加载方式
include : function(filename) { if (this.loadedFiles[filename]) return; this.addPreloadMsg('include: '+filename); var ext = filename.substr(filename.lastIndexOf('.')+1); switch (ext.toLowerCase()) { case 'js': this.loadedFiles[filename]=filename.substring(0,4)=='rico' ? this.loadRequested : this.loadComplete; document.write("<script type='text/javascript' src='"+this.jsDir+filename+"'><\/script>"); return; case 'css': var el = document.createElement('link'); el.type = 'text/css'; el.rel = 'stylesheet'; el.href = this.cssDir+filename; this.loadedFiles[filename]=this.loadComplete; document.getElementsByTagName('head')[0].appendChild(el); return; } }