我有超过50个JS + CSS文件的所有page.ie:I需要它们其实不是必要的carousel()
在.carousel
class.But已不是页面.carousel
类不需要carousel()
函数和carousel.js
和carousel.css
文件。因此,此页面不需要它们,并且加载它们需要花费更多的bytes
和times
。我该如何处理这种情况?
You could use requireJS for this. It allows you to create your javascript modular and only load the modules that you need for that page. http://requirejs.org/
It also supports css, but not completely: http://requirejs.org/docs/faq-advanced.html#css
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.