标题:火狐提示i, item没值问题
只看楼主
十夜十夜
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2009-6-29
 问题点数:0 回复次数:0 
火狐提示i, item没值问题
function addEvent(elm, evType, fn, useCapture) {
    if (elm.addEventListener) {
    elm.addEventListener(evType, fn, useCapture);
    return true;
    }
    else if (elm.attachEvent) {
    var r = elm.attachEvent('on' + evType, fn);
    EventCache.add(elm, evType, fn);
    return r;
    }
    else {
    elm['on' + evType] = fn;
    }
}
function getEventSrc(e) {
    if (!e) e = window.event;

    if (e.originalTarget)
    return e.originalTarget;
    else if (e.srcElement)
    return e.srcElement;
}
function addLoadEvent(func) {
var oldonload = window.onload;
    if (typeof window.onload != 'function') {
    window.onload = func;
    } else {
    window.onload =
        function() {
        oldonload();
        func();
        }
    }
}
var EventCache = function(){
    var listEvents = [];
    return {
        listEvents : listEvents,
   
        add : function(node, sEventName, fHandler, bCapture){
            listEvents.push(arguments);
        },
   
        flush : function(){
            var i, item;
            for(i = listEvents.length - 1; i >= 0; i = i - 1){
                item = listEvents[i];
               
                if(item[0].removeEventListener){
                    item[0].removeEventListener(item[1], item[2], item[3]);
                };
               
                /* From this point on we need the event names to be prefixed with 'on" */
                if(item[1].substring(0, 2) != "on"){
                    item[1] = "on" + item[1];
                };
               
                if(item[0].detachEvent){
                    item[0].detachEvent(item[1], item[2]);
                };
               
                item[0][item[1]] = null;
            };
        }
    };
}();


addEvent(window,'unload',EventCache.flush, false);


以上是JS代码
求解决,谢谢帮忙ufoandtiger@
搜索更多相关主题的帖子: 火狐 item 提示 
2010-07-14 10:58



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-312938-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.303418 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved