为什么Facebook和Google页面具有奇怪的ID和类? [英] Why do facebook and google pages have strange ids and classes?

查看:65
本文介绍了为什么Facebook和Google页面具有奇怪的ID和类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很多次我检查了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和类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆