代码改变世界

随笔分类 -  web---Dom

xpath选择器使用

2014-10-21 23:45 by youxin, 1414 阅读, 收藏, 编辑
摘要: 简单说,xpath就是选择XML文件中节点的方法。所谓节点(node),就是XML文件的最小构成单位,一共分成7种。- element(元素节点)- attribute(属性节点)- text (文本节点)- namespace (名称空间节点)- processing-instruction (处... 阅读全文

tbody添加垂直滚动条

2014-08-06 09:24 by youxin, 1012 阅读, 收藏, 编辑
摘要: 法一:用2个table: 123 456 789 abc 1 4 7 a 2 5 8 b 3 6 9 c 3 6 9 c 3 6 9 c 3 6 9 c 3 6 9 c 3 6 9 c 3 6 9 c 3 6 ... 阅读全文

【转】HTML中A标签与click事件的前世今生

2014-08-01 14:37 by youxin, 810 阅读, 收藏, 编辑
摘要: 在动态网页中,常常需要在单击超链接时处理一些数据,而不是跳转一个网页。在这种情况下,通常有以下三种处理方式:不设置标签的href属性,只设置onclick属性。在这种处理方式下,通常超链接文本会和正文的文本以相同的形式出现,即不 会有默认的下划线。当鼠标放在超链接上也不会显示小手的形状(除非为该超链... 阅读全文

dom元素和方法总结

2013-10-06 18:24 by youxin, 533 阅读, 收藏, 编辑
摘要: 主要是参考《精通javascript》。全局变量有:document。这个变量包含浏览器的html dom文档的引用。HTMElement这个变量是所要html dom 元素的超类对象,扩展这个变量的原型prototype就可以扩展所有的html dom元素。HTMLElement.prototype.newFunciton=function() {.......};dom操作如下:body document.body直接执行body元素。getElementByIdgetElementsByTagNamechildNodes. 下面展示了如何使用childNodes属性为一个父元素的所有子元 阅读全文

PHP - XML parse error: Extra content at the end of the document

2012-11-25 16:40 by youxin, 3050 阅读, 收藏, 编辑
摘要: php xml simplexml_load_string simplexml_load_file parse error: extra content at the end of the documentHaving not worked with parsing xml in a VERY long time (and the last time i did it, it was much harder) I ran into a problem problem when trying to load in some dynamic XML snippets that are being 阅读全文

转:Node和Element的区别

2012-08-24 00:46 by youxin, 1508 阅读, 收藏, 编辑
摘要: XmlElement is a subclass of XmlNode (and so is XmlAttribute, XmlText, XmlDocument, etc.). There is no performance implication of using one over the other at all, since XmlNode is simply the base class for all types of nodes in a DOM Xml document instance. It just so happens, that many of the APIs i. 阅读全文

Dom children 属性及childNodes

2012-08-14 18:29 by youxin, 516 阅读, 收藏, 编辑
摘要: Element.childrenchildrenreturns acollectionof child elements of the given element.Thechildrenattribute is read-only.// parg is an object reference to a <p> elementif (parg.childElementCount)// So, first we check if the object is not empty, if the object has child nodes { var children = parg.ch 阅读全文
点击右上角即可分享
微信分享提示