var dynamicLoading = { css: function(path){ if(!path || path.length === 0){ throw new Error('argument "path" is required !'); } var head = document.getElementsByTagName('head')[0]; var link = document.createElement('link'); link.href = path; lin…
var Head = document.getElementsByTagName('head')[0],style = document.createElement('style'); //文件全部加载完成显示DOM function linkScriptDOMLoaded(parm){ style.innerHTML = 'body{display:none}';//动态加载文件造成样式表渲染变慢,为了防止DOM结构在样式表渲染完成前显示造成抖动,先隐藏body,样式表读完再显示 Head.i…
在js代码中动态的加载js.css文件的引用 function addJsCssByLink(type,url) { var doc=document; if(type="js") { var link=doc.createElement("script"); link.setAttribute("type", "text/javascript"); link.setAttribute("src", url…