问题
Many a times I have inspected element on facebook and google pages but their page always have strange values as ids and classes in their html elements. Have a look at
Attributes of an element on facebook page

Attributes of element on google plus page

Q1. Is this result of some kind of obfuscation algorithm ?
It would be a nightmare to code with such attributes if devs actually use them which I don't think so.
Q2. Why are they doing it ?
回答1:
it's likely that they generate new classes and ids with each time the build is run to avoid having caching issues... this would be something thats done via the build and not defined by the developers
回答2:
Other answers partially answer this. Its not to deal with caching. Its not to avoid hackers, just makes their work a little more fun. Its mainly to reduce page size and improve bandwidth use. Its called js minifying. Its automated before publishing the code. It can be a pain to debug but there are tools to unminify which help. Also using 'caja' or closure compiler also causes this and provides protection from the js itself.
来源:https://stackoverflow.com/questions/22241329/why-do-facebook-and-google-pages-have-strange-ids-and-classes