What is the danger in including the same JavaScript library twice?

后端 未结 4 580
面向向阳花
面向向阳花 2020-12-16 09:56

One of the webapps I\'m working in is made up of many partial HTML files. If the partial requires a JavaScript library such as YUI, the YUI library is included in the partia

4条回答
  •  眼角桃花
    2020-12-16 10:30

    The browser will cache the file, downloading it only once. It will be executed more than once however. So the performance impact is negligible, but the correctness impact might not be.

提交回复
热议问题