javascript树认识
学习了javascript基础,现在学习javascript树的认识:
获取指定节点对象信息:
getElementByTagName() 以及 getElementById() 对于返回的对象可以去tagName、nodeValue、className属性 getAttribute获取对象的某个特殊属性信息 setAttribute设置某对象的属性信息
使用oLi.childNodes[0] 获取子节点对象信息 parentNode 获取父节点信息 nextSibling下一下兄弟节点对象 previousSibling上一个节点对象
firstChild 第一个子节点
使用createElement 穿件一个html标签对象 createTextNode创建一个文本节点 appendChild 添加文本节点信息 removeChild移除节点信息
replaceChild替换节点信息 insertBefore在某节点之前插入一个新的节点信息
innerHTML属性用户获取一个标签当中的所有标签html信息
以上就是列出了javascript获取、插入html标记的相关函数。
相关文档:
1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键
<table border oncontextmenu=return(false)><td>no</table> 可用于Table
2. <body onselectstart="return false"> 取消选取、防止复制
3. onpaste="return false" 不准粘贴
4. oncopy="return false;" oncut="re ......
本文来自:
http://articles.sitepoint.com/article/adobe-air-pref-javascript
在我 之前的帖子里, 我激动地开始了我的第一个AIR应用,叫做Harpoon, 仅使用HTML, CSS, 和JavaScript。我当时没时间讨论的一个特点就是,你可以使用一个XML文件存储和检索应用程序首选项。
......
今天了解了一点javascript的基础,记下来供后续学习翻阅:
数据类型的判断:typeof(var param) 判断变得数据类型
浏览器以及操作系统的判别变量 navigator.userAgent navigator.platform
var sUserAgent = navigator.userAgent;
//检测Opera、KHTML
var isOpera = sUserAgent.indexOf(" ......
事件源对象
event.srcElement.tagName
event.srcElement.type
捕获释放
event.srcElement.setCapture();
event.srcElement.releaseCapture();
事件按键
event.keyCode
event.shiftKey
event.altKey
event.ctrlKey
事件返回值
event.returnValue
鼠标位置
event.x ......