很多次我检查了facebook和google页面上的元素,但是它们的页面在其html元素中始终具有id和class之类的奇怪值.看看
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
facebook页面上元素的属性
google plus页面上元素的属性
Q1.这是某种混淆算法的结果吗?
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.他们为什么这样做?
Q2. Why are they doing it ?
推荐答案很可能每次运行构建时它们都会生成新的类和ID,以避免出现缓存问题...这将通过构建完成而不是由开发人员定义
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
更多推荐
为什么Facebook和Google页面具有奇怪的ID和类?
发布评论