ThinkPHP报js错误:Uncaught ReferenceError: out is not defined

在Public/Js/common.js中添加如下三个方法:

function   out()   
{   
    var e = getEvent();
    var   oObj   =   e.srcElement   ||   e.target;  
    var   oTr   =   oObj.parentNode;   
    if(!oTr.tag)   
        oTr.className   =   "out";   
}   
    

function getEvent()
{     //同时兼容ie和ff的写法
    if(document.all)    return window.event;       
    func=getEvent.caller;           
    while(func!=null){   
        var arg0=func.arguments[0];
        if(arg0){
            if((arg0.constructor==Event || arg0.constructor ==MouseEvent) || (typeof(arg0)=="object" && arg0.preventDefault && arg0.stopPropagation)){   
                return arg0;
            }
        }
        func=func.caller;
    }
    return null;
}
function   over()   
{   
    var e = getEvent();
    var   oObj   =   e.srcElement   ||   e.target;   
    var   oTr   =   oObj.parentNode;   
    if(!oTr.tag)   
        oTr.className   =   "over";   
}

 

你可能感兴趣的:(js,thinkphp)