Implications of multiple [removed] tags in HTML

前端 未结 5 589
野性不改
野性不改 2020-12-08 09:54

I have read that it is not recommended to instantiate jQuery multiple times in your HTML. This makes perfect sense to me, but: Isn\'t Javascript single-threaded anyway? And

5条回答
  •  伪装坚强ぢ
    2020-12-08 10:10

    Simple answer:

    In a simple scenario (tags are part of original HTML text), the browser definitely executes them one after another.

    Detailed discussion with different caveats

    JavaScript isn't necessarily single-threaded (it depends on the implementation of your JavaScript engine, e.g. see Web Workers).

    BUT, the individual

提交回复
热议问题