IE8中的空文本节点 [英] Empty Text Node in IE8

查看:186
本文介绍了IE8中的空文本节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道IE8为什么在两个跨度之间插入空文本节点.在mozilla中运行正常.

我在跨度和容器div上都应用了显示块.但这并没有解决问题.

这是渲染代码:

 <   div    样式  ="  <   span  > 
文字-公司/研究所名称*
<   span     ="  需要公司或机构名称"    class   ="      textintName" 生成  ="  > 
   文字-必须提供公司或研究所的名称
文字-空文字节点
<  输入    ="   InstName"   错误"    id   ="  textintName"  maxLength    200" 默认-title   ="  >  

< div 样式 =" < span > 文字-公司/研究所名称* < span =" 需要公司或机构名称" class =" textintName" 生成 =" > 文字-必须提供公司或研究所的名称 文字-空文字节点 < 输入 =" InstName" 错误" id =" textintName" maxLength 200" 默认-title =" >


I don''t know why IE8 inserting Empty Text Node between two spans. It is working fine in mozilla.

I have applied display block on both spans and the container div. but it didn''t solove the problem.

Here its the render code:

<div style="width: 160px; display: block;">
<span>
Text - Company / Institute Name*
<span title="Company or Institute name is required" class="error" for="textintName" generated="true">
   Text - Company or Institute name is required
Text - Empty Text Node
<input name="InstName" class="error" id="textintName" maxLength="200" default-title="Company or Institute name is required."/>

解决方案

There is zero chance than IE8 is inserting this text. ASP.NET DOES change what it renders to suit each browser, but somehow your code is creating this. Perhaps you need to step through your code, and perhaps even post the code that generates this HTML, because what you''re saying is impossible. IE8 renders HTML. It does not create it.


close your span tag. As you have open tag and missing closing tag

<div style="width: 160px; display: block;">
<span>
Text - Company / Institute Name*
<span title="Company or Institute name is required" class="error" for="textintName" generated="true">
   Text - Company or Institute name is required
Text - Empty Text Node
<input name="InstName" class="error" id="textintName" maxLength="200" default-title="Company or Institute name is required."/>


这篇关于IE8中的空文本节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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