Internet Explorer 8中HTML链接的问题 [英] Problems with HTML links in Internet Explorer 8

查看:118
本文介绍了Internet Explorer 8中HTML链接的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当用户点击非IE8浏览器中的链接时,链接正常工作,到页面上的正确位置。但是,使用Internet Explorer 8时,链接仅在不占用所有屏幕时才起作用。



为了更好地描述问题,我使用了以下屏幕截图:



无法运作


作品



第一页上的链接显示为:

 < a href =http:// domain / sede / ver / 4143?tec = fibra#fibra1537>< /一个> 

链接的ID显示为:

 < a id =fibra1537>< / a> 

发生了什么?

解决方案

我会尝试使用除id属性外的name属性。

 < a id =fibra1537name =fibra1537>< / a> 

编辑:@greg解释了为什么这里 b
$ b


对于HTML文档(以及文本/ html MIME类型),必须遵循以下处理模型来确定文档的指示部分是什么。


  1. 解析URL,并让fragid为< fragment> URL的组成部分。

  2. 如果fragid是空字符串,则文档的指示部分是文档的顶部。

  3. 如果DOM中有一个元素的ID与fragid完全相同,那么树中第一个这样的元素就是文档的指定部分;在这里停止算法。

  4. 如果DOM中有一个名称属性的值与fragid完全相同的元素,那么树中第一个这样的元素就是文档的指示部分;在这里停止算法。

  5. 否则,文档中没有指定的部分。



I'm having some problems supporting Internet Explorer 8 in my application.

When a user clicks on a link in non-IE8 browsers, the link works fine and goes to the correct position on the page. Using Internet Explorer 8, however, the links only work when the it doesn't take all of the screen.

To better describe the problem, I took the following screenshots:

DOESN'T WORK

WORKS

Links on the first page appear as such:

<a href="http://domain/sede/ver/4143?tec=fibra#fibra1537"></a>

The IDs for links appear as such:

<a id="fibra1537"></a>

What is happening?

解决方案

I would try to use the name attribute in addition to the id attribute.

<a id="fibra1537" name="fibra1537"></a>

EDIT: @greg explains why here

For HTML documents (and the text/html MIME type), the following processing model must be followed to determine what the indicated part of the document is.

  1. Parse the URL, and let fragid be the <fragment> component of the URL.
  2. If fragid is the empty string, then the indicated part of the document is the top of the document.
  3. If there is an element in the DOM that has an ID exactly equal to fragid, then the first such element in tree order is the indicated part of the document; stop the algorithm here.
  4. If there is an a element in the DOM that has a name attribute whose value is exactly equal to fragid, then the first such element in tree order is the indicated part of the document; stop the algorithm here.
  5. Otherwise, there is no indicated part of the document.

这篇关于Internet Explorer 8中HTML链接的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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