`

"event is not defined" 问题处理

阅读更多

 

FireFox 是遵守W3C, 沒有event

 

所以可能会出现" event is not defined "

而IE event给于window.event,

 

 

解决方法:

    funname( event,....)  {

 

   var evt = event ? event : (window.event ? window.event : null);

    。。。

   

   }

 

调用时要加上event参数 onmouseover="javascript: funname(event, ....); "

 

3.注意:

 

IE event.srcElement <==>  Firefox 中的 event.target

IE a.innerText  <==>  Firefox 中的 a.textContent

IE document.all[obj].style <==>  Firefox 中的 document.getElementById(obj).style

 

 

 

 

分享到:
评论

相关推荐

    出现问题a is defined高手帮忙

    // add event listeners GEvent.addDomListener(buttonDiv, 'click', function(e) { me.buttonclick_(e); }); GEvent.addDomListener(backButtonDiv, 'click', function(e) { me.backbuttonclick_(e); }); ...

    clipboard复制文本或者隐藏域到剪切板,兼容ie.chrome.firefox

    - `clipboard.on(event, callback)`: 添加事件监听器,如`'success'`或`'error'`,回调函数中可以处理复制成功或失败的逻辑。 - `clipboard.destroy()`: 销毁实例,清理监听事件。 3. **浏览器兼容性**: `...

    Videojs 网页 播放器

    此外,Videojs还支持事件监听和处理,如添加和移除事件监听器: ```javascript var myFunc = function() { // 当事件触发时执行的函数 }; myPlayer.on('eventName', myFunc); myPlayer.off('eventName', myFunc); `...

    js兼容性的16个小问题

    JavaScript 兼容性问题一直是前端开发者面临的重要挑战,尤其是在处理不同浏览器之间的差异时。本文将深入探讨在Internet Explorer(IE)和Firefox中遇到的16个JavaScript兼容性问题及其解决方案。 1. **document....

    利用getObjectURL获取图片路径实现本地预览上传图片

    在实际应用中,可能还需要考虑图片的尺寸限制、格式检查以及错误处理等问题。例如,限制只能上传一定大小或类型的图片,对上传失败的情况给出反馈等。同时,`window.URL.createObjectURL()`在某些旧版浏览器中可能不...

    my97日历控件

    func=func.caller}return null}return event}}function R(_,$){return _.currentStyle?_.currentStyle[$]:document.defaultView.getComputedStyle(_,false)[$]}function P(_,$){if(_)if($!=null)_.style.display=$;...

    数字信号处理在双音多频拨号系统中的应用

    % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % varargin command line arguments to key1 (see VARARGIN) % Choose ...

    WebOffice无法加载OFFICE

    根据所提供的信息来看,本案例涉及的主要技术领域为Web应用开发中的Office文档处理。具体来说,是在网页中嵌入Office文档查看功能时遇到的问题。问题的核心在于:由于Internet Explorer(简称IE)浏览器的编码规则...

    DevExpress VCL v2012 vol 1.6源码、例子、帮助-part2

    B218885 - Layout View - The text color specified in the View's Styles.OnGetItemStyle event handler is not applied to card layout items Q438267 - Server Mode - Clicking a Filter Row cell in a column ...

    Who's the DMO coverage

    Coverage' or `fold' is defined as the multiplicity of common-midpoint (CMP) data. For CMP stacking the coverage is consistent with the number of traces sharing a common reflection point on flat ...

    CANoe中CAPL语言调用自建的dll库

    Its syntax is similar to C, but CAPL does not require any file associations to compile or run like C/C++. It does, however, have a set of internally defined functions available to users. When these ...

    DevExpress VCL v2012 vol 1.6源码、例子、帮助

    B218885 - Layout View - The text color specified in the View's Styles.OnGetItemStyle event handler is not applied to card layout items Q438267 - Server Mode - Clicking a Filter Row cell in a column ...

    DevExpress VCL v2012 vol 1.6源码、例子、帮助-Part1

    B218885 - Layout View - The text color specified in the View's Styles.OnGetItemStyle event handler is not applied to card layout items Q438267 - Server Mode - Clicking a Filter Row cell in a column ...

    DevExpress VCL 2012 vol 1.6源码、例子、帮助-Part2

    B218885 - Layout View - The text color specified in the View's Styles.OnGetItemStyle event handler is not applied to card layout items Q438267 - Server Mode - Clicking a Filter Row cell in a column ...

    DevExpress VCL 2012 vol 1.6源码、例子、帮助-Part1

    B218885 - Layout View - The text color specified in the View's Styles.OnGetItemStyle event handler is not applied to card layout items Q438267 - Server Mode - Clicking a Filter Row cell in a column ...

    DevExpress VCL 13.1.4(v2013vol1.4) 源码-例子-帮助-part2

    Q518829 - Gantt View - Automatically view scrolling does not work when an event is sized horizontally B238298 - Gantt View - The 'Invalid argument to date encode' exception occurs when horizontally ...

    DevExpress VCL 13.1.4(v2013vol1.4) 源码-例子-帮助-part1

    Q518829 - Gantt View - Automatically view scrolling does not work when an event is sized horizontally B238298 - Gantt View - The 'Invalid argument to date encode' exception occurs when horizontally ...

    DevExpress VCL v2012 vol 1.6源码-例子-帮助-part2

    B218885 - Layout View - The text color specified in the View's Styles.OnGetItemStyle event handler is not applied to card layout items Q438267 - Server Mode - Clicking a Filter Row cell in a column ...

    DevExpress VCL v2012 vol 1.6源码-例子-帮助-part1

    B218885 - Layout View - The text color specified in the View's Styles.OnGetItemStyle event handler is not applied to card layout items Q438267 - Server Mode - Clicking a Filter Row cell in a column ...

Global site tag (gtag.js) - Google Analytics