求助js高手..
帮忙解释一下下面的js代码是什么意思,很难懂啊.
<SCRIPT language=javascript>
if(!window.attachEvent && window.addEventListener)
{
Window.prototype.attachEvent = HTMLDocument.prototype.attachEvent=
HTMLElement.prototype.attachEvent=function(en, func, cancelBubble)
{
var cb = cancelBubble ? true : false;
this.addEventListener(en.toLowerCase().substr(2), func, cb);
};
}
function scrollPosition()
{
var L, T, w=window, d=document, dd=d.documentElement;
if(w.pageXOffset) L=w.pageXOffset;
else if(dd&&dd.scrollLeft) L=dd.scrollLeft;
else if(d.body) L=d.body.scrollLeft;
if(w.pageYOffset) T=w.pageYOffset;
else if(dd&&dd.scrollTop) T=dd.scrollTop;
else if(d.body) T=d.body.scrollTop;
return { "left ": L, "top ": T};
}
function CreateWaitElement()
{
var loading = document.getElementById( 'loading ');
if (!loading)
{
var str = " <div id= 'loading ' style= 'color: #000000; \
background-color: #FFFFAF; \
padding: 0 3px; font-size: 12px; \
font-weight: bold; height: 30px; width: 160px; \
position: absolute; border: #cccccc 1px solid;\
'> 正在处理您的请求