One thing I have seen about most of the JavaScript framework is that the most common way to find / access DOM elements Way css selectors
Although it generally requires a framework to include the CSS selector parser, because they need to support the selectors, browsers are not originally, firstly the proprietary extensions of the framework.
I think these parsers are big and slow, would not it be more efficient to do anything, whose requirement does not require parse, call such an infected method?
Like something:
id ("Example"). Children () Class ("test"). The hat ("href")
<<>< P> instead of$ ("#image> .test [href]")
EDIT: You can consider it a theoretical discussion topic. I do not plan to use anything other than jQuery in any practical projects in the near future. I was just wondering why there is no one else, probably not a better approach.
Dome Traveler and Maniperation Some of the most helpful functions in the current popular JavaScript framework because they contain cross-browser problems Handle them efficiently. If you are working with DOM, you will eventually need that functionality, and whatever you write yourself is bound to be less efficient in the best ways.
In terms of speed, I will offset a little performance parsing the hit selectors by optimizing the engine contained in the engine. If you trust the programmer to specify the program (i.e. your example), then you can not remember on optimization occasions that you did not know in existence. For example in your example, suppose it is ultimately sharper right to left (search all class = "test" with first href, then check for parent). You will trust the programmer to remember these customizable quirks.
Comments
Post a Comment