


/*In the following, IE is used instead of Internet Explorer, and MF/FF is used instead of Mozzila Firefox */
//window.event
IE: There is a window.event object
FF: There is no window.event object. Event objects can be passed as arguments to functions. Such as onmousemove=doMouseMove(event)
Solution: var event = event || window.event;
example:
<script> <BR>function test(event) { <BR>var event = event || window.event; <BR>//do Something <BR>} <BR></script>
//Current mouse coordinates
IE: event.x and event.y.
FF: event.pageX and event.pageY.
Common: Both have event.clientX and event.clientY properties.
//The current coordinates of the mouse (plus the distance the scroll bar has rolled)
IE: event.offsetX and event.offsetY.
FF: event.layerX and event.layerY.
Solution:
<script> <BR>function test(event) { <BR>var event = event || window.event; <BR>//or var event = event ? event : window.event;//You can use either of these two, or you can use if else (This abbreviation) <BR>var x = event.offsetX || event.layerX; <BR>var y = event.offsetY || event.layerY; <BR>//do Something <BR>} <BR>< /script> <BR><div onmousedown="test(event)"></script>
/**Other compatible solutions are similar, so I won’t give examples one by one**/
//event.srcElement problem
Explanation: Under IE, the event object has the srcElement attribute, but no target attribute; under Firefox, the even object has the target attribute ,
but there is no srcElement attribute.
Solution: Use obj(obj = event.srcElement ? event.srcElement : event.target;)
to replace event.srcElement under IE or
under Firefox event.target. Please also pay attention to the compatibility issues of event.
//event.toElement problem
Problem:
Under IE, the even object has the srcElement attribute, but no target attribute;
Under Firefox, the even object has the target attribute, but no srcElement attribute
Solution:
var target = e.relatedTarget || e.toElement;
//The x and y coordinate positions of the label: style.posLeft and style.posTop
IE: have.
FF: No.
Common: object.offsetLeft and object.offsetTop.
//Height and width of the form
IE: document.body.offsetWidth and document.body.offsetHeight. Note: The page must have a body tag at this time.
FF: window.innerWidth and window.innerHegiht,
and document.documentElement.clientWidth and document.documentElement.clientHeight.
Common: document.body.clientWidth and document.body.clientHeight.
//Add event
IE: element.attachEvent("onclick", function);.
FF: element.addEventListener("click", function, true).
General: element.onclick=function. Although the onclick event can be used, the effects of onclick and the above two methods are different.
onclick only executes one process, while attachEvent and addEventListener execute a process list, that is, multiple processes.
For example: element.attachEvent("onclick", func1);
element.attachEvent("onclick", func2) so that both func1 and func2 will be executed.
//Custom attributes of the tag
IE: If an attribute value is defined for the tag div1, the value can be obtained by div1.value and div1["value"].
FF: Cannot be obtained using div1.value and div1["value"].
General: div1.getAttribute("value").
//document.form.item problem
IE: Existing problem: There are many statements like document.formName.item("itemName") in the existing code, which cannot be run under MF
FF/IE: document.formName.elements["elementName"]
//Problems with collection/array objects
(1) Existing problems:
Many collection objects in existing code Use () when retrieving, IE can accept it, but MF cannot.
(2) Solution:
Use [] instead as subscript operation. For example: document.forms("formName") is changed to document.forms["formName"].
Another example: document.getElementsByName("inputName")(1) changed to document.getElementsByName("inputName")[1]
//The problem of using the id of the HTML object as the object name
(1) Existing issues
In IE, the ID of the HTML object can be used directly as the variable name of the subordinate object of the document. Not in MF.
(2) Solution
Use getElementById("idName") instead of idName as an object variable
//The problem of using the idName string to obtain the object
(1) Existing problems
In IE, you can use eval(idName) to get the HTML object with the id idName, but not in MF.
(2) Solution
Use getElementById(idName) instead of eval(idName).
//The problem that the variable name is the same as an HTML object id
(1) Existing problems
In MF, because the object id is not used as the name of the HTML object, it can be used with the HTML object The variable name with the same id cannot be used in IE.
(2) Solution
When declaring variables, always add var to avoid ambiguity, so that it can also run normally in IE.
In addition, it is best not to take the same variable name as the HTML object id to reduce errors.
//Problems with document.getElementsByName() and document.all[name]
Existing problem: In IE, neither getElementsByName() nor document.all[name] can be used to obtain div elements
(I don’t know if there are other elements that cannot be taken).
//document.all
Firefox is compatible with document.all, but will generate a warning. You can use getElementById("*")
or getElementByTagName("*") instead of
. However, for attributes such as document.all.length, it is completely incompatible
//input.type attribute problem
Explanation: The input.type attribute under IE is read-only; but the input.type attribute under Firefox is read-write
//window.location.href problem
Explanation: IE or Firefox2.0. Under x, you can use window.location or window.location.href; under Firefox 1.5.x,
can only use window.location
Solution: use window.location instead of window.location.href
//Problems with modal and non-modal windows
Explanation: Under IE, modal and non-modal windows can be opened through showModalDialog and showModelessDialog; this is not possible under Firefox
Solution: Use window directly. The open(pageURL,name,parameters) method opens a new window.
If you need to pass parameters in the child window back to the parent window, you can use window.opener in the child window to access the parent window.
For example: var parWin = window.opener; parWin.document.getElementById("Aqing ").value = "Aqing";
//frame problem
Take the following frame as an example:
(1) Access the frame object:
IE: Use window.frameId or window.frameName to access this frame object. frameId and frameName can have the same name.
FF: This frame object can only be accessed using window.frameName.
In addition, window.document.getElementById("frameId") can be used in IE and Firefox to access this frame object.
( 2) Switch frame content:
You can use window.document.getElementById("testFrame").src = "xxx.html"
or window.frameName.location = "xxx.html" in both IE and Firefox To switch the content of the frame.
If you need to pass the parameters in the frame back to the parent window (note that it is not the opener, but the parent frame), you can use parent in frme to access the parent window.
For example: window.parent.document.form1.filename.value="Aqing";
//body problem
Firefox’s body exists before the body tag is fully read by the browser ;The body of IE must exist after the body tag is completely read by the browser
//Event delegation method
IE: document.body.onload = inject; //Function inject() in This has been implemented before
FF: document.body.onload = inject();
//The difference between firefox and IE’s parent element (parentElement)
IE: obj.parentElement
FF: obj.parentNode
Solution: Because both FF and IE support DOM, using obj.parentNode is a good choice
//innerText works normally in IE, but innerText does not work in FireFox . When textContent
//is used to set the style of the HTML tag in FireFox, all positional and font size values must be followed by px. This IE is also supported
//Parent node, child node and delete node
IE: parentElement, parement.children, element.romoveNode(true).
FF: parentNode, parentNode.childNodes, node.parentNode.removeChild(node).
//Operation on the options set of select
In addition to [], SelectName.options.item() is also available for enumeration elements. In addition, SelectName.options.length,
SelectName.options. add/remove works on both browsers.
Be careful to assign elements after add, otherwise it will fail.
Dynamically delete all options in the select:
document.getElementById("ddlResourceType").options.length=0;
Dynamically delete all options in the select A certain item option:
document.getElementById("ddlResourceType").options.remove(indx);
Dynamicly add an item option in the select:
document.getElementById("ddlResourceType").options.add (new Option(text,value));
IE FF dynamic deletion general method:
document.getElementById("ddlResourceType").options[indx] = null;
//Capture event
Problem:
FF does not have setCapture(), releaseCapture() methods
Solution:
IE:
obj.setCapture();
obj.releaseCapture();
FF:
window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP);
window.releaseEvents( Event.MOUSEMOVE|Event.MOUSEUP);
if (!window.captureEvents) {
o.setCapture();
}else {
window.captureEvents(Event.MOUSEMOVE|Event.MOUSEUP) ;
}
if (!window.captureEvents) {
o.releaseCapture();
}else {
window.releaseEvents(Event.MOUSEMOVE|Event.MOUSEUP);
}
//Prohibit selection of web content
Problem:
FF needs to be prohibited with CSS, IE needs to be prohibited with JS
Solution:
IE: obj. onselectstart = function() {return false;}
FF: -moz-user-select:none;
//Draw
IE: VML.
FF: SVG.
//CSS: Transparent
IE: filter:progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=60).
FF:opacity:0.6.
//CSS: Rounded Corners
IE: Rounded corners are not supported.
FF: -moz-border-radius:4px, or -moz-border-radius-topleft:4px; -moz-border-radius-topright:4px;
-moz-border-radius-bottomleft:4px ;-moz-border-radius-bottomright:4px;.
//CSS: Double line bump border
IE: border:2px outset;.
FF:-moz- border-top-colors: #d4d0c8 white;-moz-border-left-colors: #d4d0c8 white;
-moz-border-right-colors:#404040 #808080;-moz -border-bottom-colors:#404040 #808080;.

很多用户都会遇到在操作电脑的时候卡顿或者是蓝屏,这个时候我们就需要找一个最为稳定的win10版本来进行操作,整体都是非常的好用的,可以让你日常使用更为流畅。史上最稳定的win10版本1、win10正版原装系统在这里用户可以使用简单的操作,系统经过优化,具有很强的稳定性、安全性、兼容性,用户可以按照步骤实现完美机器2、俄罗斯大神精简版win10经过严格的精简操作,删除了很多不必要的功能和服务。精简后,系统的CPU和内存占用率更低,运行速度更快。3、win10精简版1909安装多台不同硬件型号的电脑

长期以来,InternetExplorer的失宠一直不是秘密,但随着Windows11的到来,现实开始了。Edge将来不再有时取代IE,它现在是微软最新操作系统中的默认浏览器。目前,您仍然可以在Windows11中启用InternetExplorer。但是,IE11(最新版本)已经有了一个正式的退役日期,即2022年6月15日,时间在流逝。考虑到这一点,您可能已经注意到InternetExplorer有时会打开Edge,而您可能不喜欢它。那么为什么会这样呢?在

越来越多的用户开始升级win11系统,由于每个用户的使用习惯不同,还是有不少用户在使用ie11浏览器,那么win11系统用不了ie浏览器,该怎么办呢?windows11还支持ie11吗?下面就来看看解决办法。win11无法使用ie11浏览器的解决方法1、首先右键开始菜单,选择“命令提示符(管理员)”打开。2、打开之后,直接输入“Netshwinsockreset”,回车确定。3、确定之后再输入“netshadvfirewallreset&rdqu

众所周知,win11一大特色就是自带安卓子系统,让我们不需要用模拟器就可以安装安卓软件,但也存在win11安卓应用卡顿的问题,这应该怎么解决呢。win11不兼容动态壁纸么:答:win11能兼容动态壁纸,如果用不了可能是软件或系统版本落后。如果是刚更新,可能是被系统壁纸覆盖了。1、如果是系统或软件版本落后,那么更新一下系统和动态壁纸软件即可。2、如果是被系统壁纸覆盖了,可以尝试打开“设置”3、接着进入“个性化”下的“背景”设置。4、然后将个性化设置背景改为“图片”5、修改完成后就能正常设置动态壁纸

Switch2是任天堂在2023年科隆游戏展公布的新机型,一些玩家担心新出来的机型与之前版本的机型卡带会不会存在兼容性问题,下面我们一起来看看吧。switch2兼容switch卡带吗答:switch2不兼容switch卡带。Switch2卡带的介绍根据任天堂的生产链公司的消息称,Switch2可能会使用64GB的卡带。它由于性能更好,支撑更多的3A游戏大作的原因,需要更大卡带容量。因为很多的游戏作品需要阉割和压缩,才能塞进一张游戏卡带里面。而且Switch的卡带容易被复制游戏内容,所以更换新卡带

近期不少的win10用户们在使用电脑浏览器的时候发现自己的ie浏览器总是自动的跳转到edge浏览器,那么win10打开ie自动跳转edge怎么关闭?。下面就让本站来为用户们来仔细的介绍一下win10打开ie自动跳转edge关闭方法吧。1、我们登录edge浏览器,点击右上角...,找下拉的设置选项。2、我们进入设置后,在左侧栏点击默认浏览器。3、最后我们在兼容性中,勾选不允许IE模式下重新加载网站,重启ie浏览器即可。

2022年6月15日是Microsoft结束对InternetExplorer11(IE11)的支持并关闭其旧版浏览器章节的日子。一段时间以来,该公司一直在提醒用户注意这一生命周期结束日期,并呼吁他们计划迁移到MicrosoftEdge。Microsoft将IE11与Windows8.1捆绑在一起,作为Windows的现代默认Web浏览器。尽管它从未达到Chrome的(当前)高度,但它是2014年使用量第二大的桌面浏览器,仅次于IE8。当然,随着20

ie快捷方式无法删除的解决办法:1、权限问题;2、快捷方式损坏;3、软件冲突;4、注册表问题;5、恶意软件;6、系统问题;7、重新安装IE;8、使用第三方工具;9、检查快捷方式的目标路径;10、考虑其他因素;11、咨询专业人士。详细介绍:1、权限问题,右键点击快捷方式,选择“属性”,在“安全”选项卡中,确保有足够的权限删除该快捷方式,如果没有,可以尝试以管理员身份运行等等。


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 English version
Recommended: Win version, supports code prompts!

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools
