1
How I create random classes and ids in HTML?
A platform here with whom I work, she, every page update, a di in Footer updates its classes and ids, in a random mode.
For example, now she’s like this:
<div id="wenro66zls" class="cwenro66zls"></div>
I updated the page, and it looked like this (OBS, same div):
<div id="ldj38hec0v" class="cldj38hec0v"></div>
It’s like a password generation, I don’t know...
Is this done with Javascript? It’s something simple?
This has the face of task automator, you can take as example Gulp and Grunt, are used to concatenate, minify codes and other tasks necessary for a good code
– Felipe Duarte
Would you know what the purpose of this platform is?
– Woss
@Felipeduarte but this occurs in the build, not when updating the page.
– Renan Gomes
@Andersoncarloswoss is their logo in the footer, the staff was display point None, ai agora da mais.
– Lucas de Carvalho
@Renan, really, anyway, this is a mystery to me
– Felipe Duarte
It has the face of being server-side. As for the generation, it is something very simple to do.
– Olimon F.
If you want to see, you can see here: http://www.pampili.com.br/ the logo at the bottom in the footer, of Bizcommerce.
– Lucas de Carvalho
Considering that the platform is Magento, I believe that the generation of this code is still done in PHP when generating the HTML delivered to the browser, just to, as you said, try to avoid the element is hidden through CSS and JS. Even just before the element there is a JS code that checks if the element was hidden, if I understand correctly.
– Woss
But in this case it would be with PHP, right? How could I create these randomized classes and Ids?
– Lucas de Carvalho