Put CSS and JavaScript in files or main HTML?

后端 未结 6 1311
-上瘾入骨i
-上瘾入骨i 2020-12-25 15:00

Although it is always recommended to put JavaScript and CSS code into appropriate files (as .js and .css), most of major websites (like Amazon, fac

6条回答
  •  灰色年华
    2020-12-25 15:17

    If your css and javascript code is for a global usage, then it is best to put them into appropriate files. Otherwise, if the code is used just by a certain page, like the home page, put them directly into html is acceptable, and is good for maintenance.

提交回复
热议问题