javaScript 函数解决办法

javaScript 函数//绑定输入框事件(function(){var oLo $id(loginBtn),oRg $id(lfBtnReg),oAutoTip

javaScript 函数


//绑定输入框事件
(function(){
var oLo = $id('loginBtn'),
oRg = $id('lfBtnReg'),
oAutoTips = $id('whatAutologinTip'),
oPwLabel = $id('pwdPlaceholder');

//帐号
fEventListen(oIdL,'mouseover',function(){
oIdL.className += ' loginFormIpt-over';
});
fEventListen(oIdL,'mouseout',function(){
oIdL.className = oIdL.className.replace(/\sloginFormIpt-over/g, '');
});
fEventListen(oId,'focus',function(){
oId.className += ' loginFormTdIpt-focus';
oIdL.className += ' loginFormIpt-focus';
});
fEventListen(oId,'blur',function(){
oIdL.className = oIdL.className.replace(/\sloginFormIpt-focus/g, '');
if(oId.value == ''){
oIdL.className += ' showPlaceholder';
oId.className = oId.className.replace(/\sloginFormTdIpt-focus/g, '');
}else{
oId.value = fCheckAccount(oId.value);
}
});
function fIdInputEvent(){
if(oId.value==''){
oIdL.className += ' showPlaceholder';
}else{
oIdL.className = oIdL.className.replace(/\sshowPlaceholder/g, '');
var b = new RegExp(/\sloginFormTdIpt-focus/g).test(oId.className);
if(!b){
oId.className += ' loginFormTdIpt-focus';
}
}
}
var sEventName = '';
var bIsIe = false;
if(document.body.onpropertychange === null){
sEventName = 'propertychange';
var bIsIe = true;
}else{
sEventName = 'input';
fCheckAlways();
}
var el = document.createElement('div');
el.setAttribute('oninput', 'return;')
if(typeof el.oninput === 'function'){
sEventName = 'input';
if(bIsIe){
fCheckAlways();
}
}
fEventListen(oId, sEventName, fIdInputEvent);
//点击双击文字
fEventListen(oIdLabel, 'dbclick', function(){
oId.focus();
});
fEventListen(oIdLabel, 'click', function(){
oId.focus();
});

//密码
fEventListen(oPwL,'mouseover',function(){
oPwL.className += ' loginFormIpt-over';
});
fEventListen(oPwL,'mouseout',function(){
oPwL.className = oPwL.className.replace(/\sloginFormIpt-over/g, '');
});
fEventListen(oPw,'focus',function(){
oPw.className += ' loginFormTdIpt-focus';
oPwL.className += ' loginFormIpt-focus';
fCheckPw(100);
});
fEventListen(oPw,'blur',function(){
oPwL.className = oPwL.className.replace(/\sloginFormIpt-focus/g, '');
if(oPw.value == ''){
oPwL.className += ' showPlaceholder';
oPw.className = oPw.className.replace(/\sloginFormTdIpt-focus/g, '');
}
});
function fPwInputEvent(){
if(oPw.value==''){
oPwL.className += ' showPlaceholder';
}else{
oPwL.className = oPwL.className.replace(/\sshowPlaceholder/g, '');
var b = new RegExp(/\sloginFormTdIpt-focus/g).test(oPw.className);
if(!b){
oPw.className += ' loginFormTdIpt-focus';
}
}
}
fEventListen(oPw, sEventName, fPwInputEvent);
//点击双击文字
fEventListen(oPwLabel, 'dbclick', function(){


oPw.focus();
});
fEventListen(oPwLabel, 'click', function(){
oPw.focus();
});

//两周自动登录文字
fEventListen(oAutoLoginTxt,'mouseover',function(){
oAutoTips.style.display = 'block'
});
fEventListen(oAutoLoginTxt,'mouseout',function(){
oAutoTips.style.display = 'none'
});
//登录按钮
fEventListen(oLo,'mouseover',function(){
oLo.className += ' btn-login-hover'
});
fEventListen(oLo,'mouseout',function(){
oLo.className = 'btn btn-login'
});
fEventListen(oLo,'mousedown',function(){
oLo.className += ' btn-login-active'
});
//注册按钮
fEventListen(oRg,'mouseover',function(){
oRg.className += ' btn-reg-hover'
});
fEventListen(oRg,'mouseout',function(){
oRg.className = 'btn btn-reg'
});
fEventListen(oRg,'mousedown',function(){
oRg.className += ' btn-reg-active'
});
fEventListen(oRg,'mouseup',function(){
oRg.className = 'btn btn-reg'
});
//版本选择
fEventListen(oStyleConf,'click',function(){
oStyleConfBlk.style.display = 'block';
});
oStyleConfBlk.onmouseout = function(e){
var oE = e || window.event;
var that = this;
fE(function(){
oStyleConfBlk.style.display = 'none';
}, oE, that);
};
//线路选择
$id('locationTest').onmouseout = function(e){
var oE = e || window.event;
var that = this;
fE(function(){
$id('locationTest').style.display = 'none';
}, oE, that);
};
//阻止事件触发
function fE(fFunc, oE, oThat){
var e = oE,
relatedTarget = e.toElement || e.relatedTarget;
while(relatedTarget && relatedTarget != oThat){
relatedTarget = relatedTarget.parentNode;
}
if(!relatedTarget){
fFunc();
}
}

//还没设置手机号按钮2
fEventListen($id('extBtnMoblogin'),'click',function(){
fShowPhoneReg(true);
});
//手机注册框关闭按钮
fEventListen($id('phoneRegDivClose'),'click',function(){fShowPhoneReg(false);});
/**
//关闭手机提示
fEventListen($id('mobtips_close'),'click',function(){
gMobileNumMail.forbidden();
});
*/
})();


网易126邮箱登录网页界面的javaScript部分代码。
省略函数体实现后应该为:(function(){})();请教这是什么意思?
完整代码请上http://www.126.com查看源码。 function javascript
[解决办法]
( function(){} )()  一个匿名函数直接运行
正常 function fn(){};fn(),他是省去名称,并直接执行