日期:2014-05-16  浏览次数:20344 次

请问这个JS代码运行后出现错误,缺少什么元素?
JScript code

(function(){
    var _init = function() {
        var debug = (location.hostname.indexOf('.taobao.com') == -1);
        if (TB.bom.getCookie('_tb_defaultbackpop_') == 1 && !debug)
            return;    

        var nowDate = new Date();
        var nowTime =nowDate.getHours()*3600 + nowDate.getMinutes()*60 + nowDate.getSeconds();
        var DAY = 24*3600;
        var leaveTime = DAY - nowTime;
        TB.bom.setCookie('_tb_defaultbackpop_', 1, leaveTime/DAY, document.domain, '/');    

        var popuped = false;
        var popAd = function() {
            if (popuped) return;
            popuped = true;
            var purl='http://www.taobao.com/promotion/defaultbackpop.html';
            var w=760;
            var h=480;
            var adPopup = window.open('about:blank', '_blank','width='+w+',height='+h+', ...');
            adPopup.blur();
            adPopup.opener.focus();
            adPopup.location = purl;
            $E.removeListener(document.body, 'click', arguments.callee);
            return adPopup;
        }
        try {
            popAd();
        } catch (e) {
            popuped = false;
            $E.on(document.body, 'click', popAd);
        }
    }
    $E.on(window, 'load', _init);
})();





------解决方案--------------------
$E未定义

肯定还需要引用其它脚本文件或脚本段!