-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTest Anything.html
346 lines (286 loc) · 7.64 KB
/
Test Anything.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test Anything</title>
<style>
*{
margin: 0;
padding: 0;
}
body{
font-size: 16px;
}
.div1{
/*width: 200px;*/
height: 200px;
/*margin: 200px;
padding: 50px;
border: 100px solid red;
position: relative;*/
}
.div2,.div3{
width: 50px;
height: 50px;
border: 1px solid blue;
position: absolute;
margin: 20px;
/*left: 30px;
top: 20px;*/
}
.ul1{
/*display: none;*/
border: 50px solid blue;
margin-top: 10px;
}
.nav{
/*filter:progid:DXImageTransform.Microsoft.Alpha(Opacity=50)*/
/*display: none;*/
/*filter:alpha(opacity=50);
zoom:1;
opacity: 0.3;*/
margin: 50px;
/*border : 100px solid red;*/
}
.nav li{
width: 100px;
height: 50px;
border: 1px solid red;
}
ul{
/*display: none;*/
}
.wrapper{
width: 300px;
display : inline-block;
border: 1px solid red;
}
.wrapper h1{
padding: 20px;
border: 1px solid blue;
}
.wrapper p{
/*display: none;*/
border: 10px solid green;
margin: 10px;
padding: 10px;
height: 100px;
overflow: scroll;
}
.fixed{
/*display: none;
width: 100px;
height: 100px;
position: fixed;
background: red;
top: 10;
left: 10;*/
}
.wrapper>span{
color: red
}
#lee{
border: 100px solid red;
padding: 50px;
}
</style>
<!-- <script>
var callback = function(data){
alert(data.msg);
}
</script>
<script src="http://127.0.0.1:100/ajaxTest/jsonpTest.js">
</script> -->
</head>
<body class="z">
<div class="ajaxtest">
<button class="ajaxbut">获取数据</button>
</div>
<div class="fixed">
zzzzzzzzzz
<span>sss</span>
</div>
<div class="scroll">
sssssssss
</div>
<div class="div">
<button id="show">显示</button>
<button id="hide">隐藏</button>
<button id="toggle">切换</button>
</div>
<div class="wrapper classz">
<span class="classz">222</span>
<!-- <p></p> -->
<h1>绿叶学习网简介</h1>
<p>绿叶学习网成立于2015年4月1日,是一个富有活力的技术学习网站。绿叶学习网为广大网络工作者(网页开发人员、站长等)提供各种精品教程以及最精华资料。绿叶学习网跟其他垃圾采集站不一样,绿叶学习网中的每一个课程、每一篇文章,甚至每一个知识点,都凝聚了本人的最辛勤的汗水。多少日日夜夜,本人呕心沥血在一遍一遍地编辑,为的是给广大网站爱好者提供最精华的知识。</p>
</div>
<ul class="nav">
<li>111</li>
<li>222</li>sdsdf
<li>333</li>
<li>444</li>
<li>555</li>
</ul>
<div class="div1">
<div class="div3">22222 <p>d</p><span></span></div>
</div>
<div id="header">
</div>
<div id="content">
<div id="box" class="classz">
<h1 class=" color dzzz color">Welcome</h1>
<h1 class="zz color ">Welcome</h1>
<p class="but"><span>zzz</span>
Welcome to the official website of Jay Skript and the Domsters. Here, you can <a href="#">learn more about the band</a>, view <a href="#">photos of the band</a>, find out about <a href="#">tour dates</a> and <a href="#">get in touch with the band</a>.
</p>
</div>
</div>
<button class="but1" id="zz">显示</button>
<button class="but2">隐藏</button>
<button class="but3">切换</button>
<button class="but4">停止</button>
<ul class="ul1" >
<li class="li1">qqqzzzzzzzzzzzzzzzzzzzzzzzzz</li>
<li class="li2 zzq">wwwzzzzzzzzzzzzzzzzzzzzzzz</li>
<li class="li3">eeezzzzzzzzzzzzzzzzzzzzzzzzzz <p>sssssp <span>zz</span></p></li>
</ul>
<ul class="ul2" id="lee">
ssssdsd
<li class="zs">qqq</li>sss
<li class="ss li5">www</li>
<li class=" li li2 " id="lz1">eeespan <span class="li1"></span></li>
<li class="li6" id="zzzz">eeespan <span>zz</span></li>
<li class="li6">eeespan <span>zz</span></li>
</ul>
<input type="text" name="uesrname" id="user" value="wqe"><br>
输入字符长度为:<span id="len">0</span>
<input type="radio" name="w">11
<input type="radio" name="w">22
<p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>1</p><p>155</p>
<script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script>
<!-- <script src ='Anything.js'></script> -->
<script>
//$('head').append('<script src="http://127.0.0.1:100/ajaxTest/jsonpTest.js"><\/script>')
$(function(){
function GetData(){
var xhr=new XMLHttpRequest();
xhr.open("get","http://localhost:1337/",true);
xhr.onreadystatechange=function(){
if(xhr.readyState==4){
if(xhr.status==200){
alert(xhr.responseText)
document.getElementById("lee").innerHTML=xhr.responseText;
}
}
}
xhr.send(null);
}
$('.ajaxbut').click(function(){
//GetData();
// var xhr = new XMLHttpRequest();
// xhr.open('GET','localhost:1337',true);
// xhr.onreadychange = function(){
// if(xhr.readyState == 4){
// if(xhr.status == 200){
// //alert(xhr.responseText);
// alert(11)
// }
// }
// }
// xhr.send(null);
// $.ajax({
// url : 'localhost:1337',
// success :
// });
//jsonp:
$.ajax({
url : 'http://127.0.0.1/ajaxTest/jsonpTest.js',
dataType : 'jsonp',
jsonp : 'callback',
jsonpCallback:"flightHandler",
success : function(data){
alert(data)
}
});
});
$('#show').click(function(){
$('.wrapper').slideUp(1000)
})
$('#hide').click(function(){
$('.wrapper').slideDown(1000)
})
$('#toggle').click(function(){
$('.wrapper').slideToggle(1000)
})
//console.log(s.replace('he','zz'))
//var s = document.getElementById('lee')
//console.log(s.getAttribute('class'))
//console.log(s.setAttribute('className','ssss'))
//var arr1 = [1,2,3];
//var arr2 = [4,5,6];
//var arr3 = arr1.concat(arr2); //[1,2,3,4,5,6]
//console.log(isInArray(1,arr1)); //6
//console.log($('#lee li ').hasClass('li5'))
//console.log(window.parentNode)
//var arr = ['','']
//console.log(arr.indexOf('li2'))
//console.log($(' li').prev().css('color','red'))
// addEvent(document,'dbclick',function(){
// alert(1112)
// })
// // document.onclick = function(){
// // alert(1112231231)
// // }
// var s = document.getElementById('lee');
// console.log($('input').change(function(index){
// alert(111)
// }))
//$('p').remove();
//console.log($('.li6').eq(-1))
//console.log($(' .li5').wrapAll('<div></div>'))
//var a = $('#lee li ')
//console.log(document.querySelectorAll('#lee li '))
//alert(111)
// $(function(){
// // var li = document.getElementsByClassName('classz');
// // console.log(li.length)
// //console.log(getNextSibling(li))
// //console.log($(li).hasClass('li4'))
// //console.log($(li).hasClass('li4'))
// //var a=
// //console.log(document.querySelectorAll('#content h1'))
// //$('div p .span , #div~h1 z , ')
// })
// var str = ' #id .class>p span ';
// var arr = [];
// var start = 0;
// for(var i=0; i<str.length; i++){
// if(/[\s>~+]/.test(str.charAt(i))){
// arr.push(str.slice(start,i));
// start = i;
// }
// }
// console.log(arr);
// console.log('' == '');
// console.log(str.length)
// var div = document.getElementsByTagName('div');
// console.log(div.length)
//console.log($('div p').length)
//console.log($().css)
// Anything.prototype = new Array();
// function Anything() {
// }
// Anything.prototype.say = function(){
// alert(1111)
// }
// var a = new Anything();
// a.push(1,2,3)
// console.log(a instanceof Array)
// console.log(a instanceof Anything)
// console.log(a)
// var b =[];
// b.say()
})
</script>
</body>
</html>