IE8中最有可能导致Javascript错误的原因是什么? [英] What are the most likely causes of Javascript errors in IE8?

查看:107
本文介绍了IE8中最有可能导致Javascript错误的原因是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在IE8中看到很多Javascript错误,这些错误在IE7(以及Firefox,Chrome和Safari)中运行良好。我知道IE对Javascript安全性等内容进行了一些更改。其中一些没有提供明确的错误消息 - 跨域违规等事情最终会引发非常模糊的例外。

I'm seeing a lot of Javascript errors in IE8 on pages which worked fine in IE7 (and Firefox, Chrome, and Safari). I know that IE made some changes to things like Javascript security. Some of these don't give clear error messages - things like cross-domain violations can end up throwing very vague exceptions.

让我们制作一份顶级违规者清单,当我们'重新排除IE8 Javascript错误。请列出一个更改IE8 Javascript导致Javascript错误的方式。

Let's make a checklist of top offenders when we're troubleshooting IE8 Javascript errors. Please list one change to the way IE8 Javascript that would cause a Javascript error.

推荐答案

我可以验证unique_username发布的那些是准确的!

I can verify that the ones posted by "unique_username" are accurate!

(引用)
实际上TON的东西已经改变了。

(quote) Actually a TON of stuff has changed.

首先,它真的很重要。在IE8中,有3种(三种)模式。

First off, it REALLY matters what mode you are in. In IE8, there are 3 (THREE) modes.


  • IE5怪癖 - 你的页面没有doctype,像IE5这样的页面渲染

  • IE 7标准模式 - 你有一个doctype,但要么选择退出IE8标准模式,要么正在运行localhost或兼容模式

  • IE 8标准模式 - 您有一个doctype,并且在INTRANET(默认模式)

现在,如果你在IE5 / IE7模式下渲染,那么除了会添加一些不应该干扰你的页面的方法之外什么都没有改变。

Now, if you are rendering in IE5/IE7 mode, then Nothing changes except that there will be a few methods added that shouldn't interfere with your page.

然而,如果像大多数人一样,那你就是在运行wi在文档类型集中,因此在IE8标准模式下,发生了以下更改。

However, if like the majority, you are running with a doctype set, and thus in IE8 Standards mode, the following changes have occurred.

1.) document.getElementById( id ); //now only returns the CORRECT matches!

2。) .getElementsByName(name); //现在只返回CORRECT匹配! nope,不固定!

2.) .getElementsByName( name ); //now only returns the CORRECT matches! nope, not fixed!

3.) .getAttribute( name ); //returns the CORRECT value for the given attribute!
4.) .setAttribute( name, value ); //actually SETS the name/value CORRECTLY (no more cAmElCaSe crud)!
5.) CSS Expressions are NO LONGER allowed (deprecated)
6.) Operation Aborted errors will still be thrown (in some cases) however the cases are fewer, and the error won't kill the entire page/DOM
7.) The attributes[] array on elements should (from the RC build onwards) be correct in terms of contents, have a length, etc.
8.) Button elements now submit the contents of the value attribute, NOT the HTML contents of the Button Tag

还有一堆CSS 2.1修复,因此之前变得怪异或者需要黑客的东西应该更好。 (有关alpha /透明度的详细信息,请参见下文 - 已发生重大变化)

There has also been a bunch of CSS 2.1 fixes, so things that rendered weird before, or needed hacks, should be much better. (see below for details on alpha/transparency - there's been big changes)

请参阅 IE博客了解详情。

另见 Web Bug Track ,了解有关IE8(以及所有其他浏览器)的错误,修复程序的详细信息

Also see Web Bug Track for fine grained details on Bugs, Fixes for IE8 (and all other browsers)

SVG,圆角,基于ECMAScript的事件监听器,更好的表单元素设计/事件等仍然缺失。

SVG, rounded corners, ECMAScript based Event Listeners, Better Form Element design/events etc. are still missing.

PS如果你有具体问题,请告诉我们,我们会帮助您找到它们。 ; - )

PS If you have specific issues, let us know and we'll help hunt them down for you. ;-)

更新:

windows.resize事件目前在IE8 Beta2和IE8中被破坏合作伙伴版本1(不会触发)现已在RTM版本中修复

window.resize events are currently broken in IE8 Beta2 and IE8 Partner Release 1 (will not fire) now fixed in RTM build

window.open(); in IE8 Partner Release is sometimes failing "claiming" that the target url is not available (quirky, hard to reproduce)

这篇关于IE8中最有可能导致Javascript错误的原因是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆