如何忘记jQuery而换用原生的JavaScriptAPI

 

转自github.com/roman01la

How to forget about jQuery and start using native JavaScript APIs

JavaScript is here and it’s ready for you, but probably you are not ready for it yet. Why not using jQuery? Because it’s slow and your website doesn’t really need extra weight.I’m not going to argue about libs vs native. Sometimes it’s really hard to live without all that magic stuff. But I’m going to argue about loading kilos of code just only for a one-character-selector-function aka $ or things like that.Assuming that shorthands is not the case, everyone use jSomething because of it’s support for IE, animation handling and the only selector function.

阅读更多