Permalink
Browse files

update

  • Loading branch information...
1 parent 054949e commit 0313e0ac5e72dc9da0cee1420fe8dca2fa41e7d2 @RubyLouvre committed Mar 9, 2013
Showing with 16 additions and 14 deletions.
  1. +1 −1 flow.js
  2. +11 −8 index.html
  3. +1 −1 more/store.js
  4. +2 −2 node.js
  5. +1 −2 query.js
View
@@ -1,5 +1,5 @@
//=========================================
-// 组件交互模块v1 by 司徒正美
+// 流程模块v1 by 司徒正美 (流程控制,消息交互)
//=========================================
define("flow", ["class"], function($) {
//观察者模式
View
@@ -7,18 +7,21 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>测试</title>
<script src="mass.js"></script>
- <script>
- window.onload = function(){
-require("node", function($){
- var a = $("div")
- var b = $("div").remove();
- alert(a[0])
+ <script id="444">
+
+require("node,ready", function($){
+ var a = $("#aa")[0];
+ alert("|"+a.text +"|");
+ alert("|"+a.textContent +"|")
+ alert("|"+a.innerText +"|")
+ alert("|"+a.innerHTML +"|")
})
-
-}
</script>
</head>
<body>
+ <select>
+ <option id="aa"><b> wwwww</b> </option>
+ </select>
<div><div id="test1">test1</div></div>
<div><div id="test2">test2</div></div>
</body>
View
@@ -126,7 +126,7 @@ define("store", this.JSON && JSON.parse ? ["support"] :["$support","./json2"], f
}
function withIEStorage(storeFunction) {
return function() {
- var args = Array.call([],arguments)[0];
+ var args = [].slice.call(arguments);
args.unshift(storage)
// http://msdn.microsoft.com/en-us/library/ms531081(v=VS.85).aspx
// http://msdn.microsoft.com/en-us/library/ms531424(v=VS.85).aspx
View
@@ -163,8 +163,8 @@ define("node", ["support", "class", "query", "data"].concat(top.dispatchEvent ?
text: function(item) { // 取得或设置节点的text或innerText或textContent属性
return $.access(this, function(el) {
if (this === $) { //getter
- if (el.tagName === "OPTION" || el.tagName === "SCRIPT") {
- return el.text;
+ if (el.tagName === "SCRIPT") {
+ return el.text;//IE6-8下只能用innerHTML, text获取内容
}
return el.textContent || el.innerText || $.getText([el]);
} else { //setter
View
@@ -27,8 +27,7 @@ define("query", ["mass"], function($) {
return false;
},
getText: function() {
- //获取某个节点的文本,如果此节点为元素节点,则取其childNodes的所有文本,
- //为了让结果在所有浏览器下一致,忽略所有空白节点,因此它非元素的innerText或textContent
+ //获取某个节点的文本,如果此节点为元素节点,则取其childNodes的所有文本
return function getText(nodes) {
for (var i = 0, ret = "", node; node = nodes[i++];) {
// 对得文本节点与CDATA的内容

0 comments on commit 0313e0a

Please sign in to comment.