Does jQuery $(this) need to be cached

后端 未结 6 678
一生所求
一生所求 2021-01-13 14:05

I recently came accross some blog posts about jQuery performance (i.e. http://net.tutsplus.com/tutorials/javascript-ajax/10-ways-to-instantly-increase-your-jquery-performanc

6条回答
  •  庸人自扰
    2021-01-13 14:45

    Well, if you use $this only once, it doesn't really help, but if you use it more that once, it should gain performance.

    The big question is, how much performance? It's possible that it's hardly measurable. But it's a good practice to do so anyway.

提交回复
热议问题