js警告:分析属性'left'出错。声明被丢弃
2009-04-29 15:04
387 查看
1:一种就像网上很多人说的:
css或js不规范;
如:width=10;没有加单位;
width=10px;
2:如果用到:
如果无此节点,则属性返回 null。
注意:Internet Explorer 会忽略节点间生成的空白文本节点(例如,换行符号),而 Mozilla 不会这样做。因此,在下面的例子中,我们会使用一个函数来检查首个子节点的节点类型。
意思:也就是说,你当前那个节点后面跟的节点一定不能是空白,
说白了,用nextSibling方法调用的节点,一定要跟在当前节点后面,不能有空白,也不能换行;
特别注意:目前,IE与firfox都会忽略空白,
例如:<input type='text' name='aa'/>
<input type='text' name='bb'/>
aa.nextSibling就会出现警告,如果通过这种方法得到bb的坐标来定位,就不会正常显示;
正确的是:<input type='text' name='aa'/><input type='text' name='bb'/>
aa与bb两个HTML元素,在同一行,且中间不空白;
css或js不规范;
如:width=10;没有加单位;
width=10px;
2:如果用到:
nodeObject.nextSibling的,nextSibling
定义和用法
nextSibling 属性可返回某个元素之后紧跟的元素(处于同一树层级中)。如果无此节点,则属性返回 null。
注意:Internet Explorer 会忽略节点间生成的空白文本节点(例如,换行符号),而 Mozilla 不会这样做。因此,在下面的例子中,我们会使用一个函数来检查首个子节点的节点类型。
意思:也就是说,你当前那个节点后面跟的节点一定不能是空白,
说白了,用nextSibling方法调用的节点,一定要跟在当前节点后面,不能有空白,也不能换行;
特别注意:目前,IE与firfox都会忽略空白,
例如:<input type='text' name='aa'/>
<input type='text' name='bb'/>
aa.nextSibling就会出现警告,如果通过这种方法得到bb的坐标来定位,就不会正常显示;
正确的是:<input type='text' name='aa'/><input type='text' name='bb'/>
aa与bb两个HTML元素,在同一行,且中间不空白;
相关文章推荐
- 警告:隐式声明与内建函数'exit'不兼容解决方案
- 关于HTML5中解析left或者top等的值时出错,声明被丢弃问题解决
- 百度UEditor组件出现Parameters: Invalid chunk '' ignored警告的分析
- 百度UEditor组件出现Parameters: Invalid chunk '' ignored警告的分析
- 警告:隐式声明与内建函数'exit'不兼容解决方案
- 百度UEditor组件出现Parameters: Invalid chunk '' ignored警告的分析
- 警告:隐式声明与内建函数'exit'不兼容解决方案
- div+css - CSS标准 - 8.3 Margin properties: 'margin-top', 'margin-right', 'margin-bottom', 'margin-left', and 'margin' - 8.3边距属性
- js(jquery)出错: 'null' 为空或不是对象
- JS:offsetWidth\offsetleft 等属性&图片连续滚动的实现
- objective-c的属性声明问题“ivar used by '@synthesize' declaration must be an existing iva”
- [MySQL 工具] pt-query-digest使用出错问题分析Can't locate Time/HiRes.pm in @INC
- File `Makefile' has modification time 1.8e+06 s in the future这种警告的原因分析及解决方法
- TextBox属性Text 中使用DataBinder.Eval(Container.DataItem, "VacationWork_order")的时候出错的解决方法
- accesslog或者cookie'log的shell常用分析脚本
- warning C4996: '_snprintf' was declared deprecated 警告信息的消除方法
- 【总结】在两个Activity之间进行跳转时出错原因分析(二)——在AndroidManifest.xml未声明导致
- 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:webProject'
- 去掉Xcode工程中的某种类型的警告 Implicit conversion loses integer precision: 'NSInteger' (aka 'long') to 'int32
- torch7-- errors using gfx in the tutorial--Cannot find module 'pty.js'--[gfx.js] rendering cell