In my website http://www.theprinterdepo.com, you can view the page source, I have a code that my seo consulting suggested me to move to an external file.
Its an ecommerce site built on magento. ITs a free open source tool, so I did not developed it, I just installed it.
I need to know what the code does.
window.HDUSeed='c7025284683262a8eb81056c48968d74';
window.HDUSeedIntId = setInterval(function(){
if (document.observe) {
document.observe('dom:loaded', function(){
for (var i = 0; i < document.forms.length; i++) {
if (document.forms[i].getAttribute('action') && document.forms[i].getAttribute('action').match('contacts/index/post')) {
var el = document.createElement('input');
el.type = ('hidden');
el.name = 'hdu_seed';
el.value = window.HDUSeed;
document.forms[i].appendChild(el);
}
}
});
clearInterval(window.HDUSeedIntId)
}
}, 100);
In Brief
This script calls a function at an interval of every 100ms or so (as it’s not guaranteed) to try to verify for the DOM’s load status to add a hook on it.
If loaded, it then processes all the forms present in the page, looking for one with an “action” attribute (usually to submit it someplace, here
contacts/index/post).To all such forms found, it adds a new hidden input element containing “seed” value, but we cannot tell you what it is used for without knowing more about the codebase.
Detailed Code Review