1. 程式人生 > >多個 js、css 檔案怎麼統一引用?

多個 js、css 檔案怎麼統一引用?

新建commentJs.js檔案,把需要引用的js用以下方法放入

document.write('<script src="static/js/student/student.js" type="text/javascript"></script>');
document.write('<script src="static/js/jquery-1.8.2.min.js" type="text/javascript"></script>');
document.write('<script src="static/layui/layui.js" type="text/javascript"></script>');
document.write('<script src="static/js/student/student.js" type="text/javascript"></script>');

呼叫是隻需要呼叫commonJs.js一個就可以了
 

css檔案引用:

@import "../layui/css/layui.css";