关注公众号:青山有路

js引用外部css,js

js引用外部css,js

function loadExtentFile(filePath, fileType){

if(fileType == “js“){

var oJs = document.createElement(‘script’);

oJs.setAttribute(“type”,”text/javascript”);

oJs.setAttribute(“src”, filePath);//文件的地址 ,可为绝对及相对路径

document.getElementsByTagName(“head”)[0].appendChild(oJs);//绑定

}else if(fileType == “css”){

var oCss = document.createElement(“link”);

oCss.setAttribute(“rel”, “stylesheet”);

oCss.setAttribute(“type”, “text/css”);

oCss.setAttribute(“href”, filePath);

document.getElementsByTagName(“head”)[0].appendChild(oCss);//绑定

}

}


版权所有丨如未注明 , 均为原创 , 转载请注明js引用外部css,js
喜欢 (0)

Warning: Use of undefined constant PRC - assumed 'PRC' (this will throw an Error in a future version of PHP) in /www/wwwroot/gaowenjie.cc/wp-content/themes/Git-alpha/comments.php on line 17
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到