I'm building a normal webpage which requires me to load about five CSS files and ten Javascript files.
(我正在建立一个普通的网页,要求我加载大约五个CSS文件和十个Javascript文件。)
- When loading them separately in the HTML page, my webpage loads fine.
(在HTML页面中单独加载它们时,我的网页加载正常。)
Now for production, I concatenated all the Javascript into a single file, in the order needed, and all the CSS into another file.
(现在进行制作,我将所有Javascript连接到一个文件中,按所需顺序连接,将所有CSS连接到另一个文件中。)
But when I try to run the web page with the concatenated files it throws an error saying:(但是,当我尝试使用连接文件运行网页时,它会抛出错误说:)
Uncaught TypeError: undefined is not a function
On the line where jquery.min.js is being loaded in the concatenated Javascript file.
(在连接的Javascript文件中加载jquery.min.js的行。)
What can I do to mitigate this?
(我该怎么做才能缓解这种情况?)
I want to concatenate all files and minify them for production.(我想连接所有文件并缩小它们以进行生产。)
Please help.(请帮忙。)
EDIT: I merged the Javascript and CSS in the order they were when they were being loaded individually and were working fine.
(编辑:我按照他们单独加载时的顺序合并了Javascript和CSS,并且工作正常。)
ask by ghostCoder translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…