-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.html
50 lines (49 loc) · 1.44 KB
/
page.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!doctype html>
<head>
<script src="sourdough.js"></script>
<script>
$(document).each(function(){
}).listen('DOMContentLoaded',function(){
var o = $('div',['body',document,window],{a:1});
console.log(o.length,o);
o = $('div',['body',document,window],{a:1},'a');
console.log(o.length,o);
o = $('a','a');
console.log(o.length,o);
return;
console.log('--',this);
$(this).find('a').each(function(a){
this.appendChild(document.createTextNode(a));
});
});
/*
$(window).bind('DOMContentLoaded',function(e){
console.log(e.type,this);
}).each(function(){
console.log(this);
});
$(document).bind('DOMContentLoaded',function(e){
console.log(e.type,this);
}).each(function(){
console.log(this);
});
console.log($(window).listen('load',function(){
$('body').bind('keypress',function(e){ console.log(e.type,e); }).trigger('keypress');
$('body').trigger('keypress').trigger('keypress');
// TODO test other events too
// console.log($('div').text(), $('div').text('ping'));
}),'go');
*/
/*
test ajax with
$('body').xhr('/', {success:function(e){ console.log('success',this.status,this, e); }, error: function(e){ console.log('error',this.status,this,e); }, before:function(){ console.log('before', this); }, after:function(){ console.log('after', this); }}).each(function(){console.log('each',this)});
*/
</script>
</head>
<body>
body
<div id="a">a <a href="#">#</a></div>
<div id="b">b <a href="#"># <span>span</span></a></div>
<div id="c">c <a href="#">#</a></div>
</body>
</html>