私は自分のウェブサイトで奇妙なことが起こっていることに気づいていたので、これに遭遇したときにファイルを調べていました:
if( typeof document.getElementsByClassName != 'function' ) {
document.getElementsByClassName = function(classname) {
var node = document.body;
var a = [];
var re = new RegExp('(^| )'+classname+'( |$)');
var els = node.getElementsByTagName("*");
for(var i=0,j=els.length; i<j; i++)
if(re.test(els[i].className))a.push(els[i]);
return a;
}
}
これが何をしているのか誰か知っていますか?