-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
42 lines (42 loc) · 942 Bytes
/
test.js
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
/**
* Created by denniszhang on 16/3/2.
*/
"use strict"
class Overlay {
constructor() {
var node=document.createElement('div');
node.id='overlay';
node.className='Hide';
$('body').appendChild(node);
var that=this;
node.addEventListener('click',function(){
that._close();
})
}
open(){
$('#overlay').removeClass('Hide')
}
_close(){
$('#overlay').addClass('Hide');
}
}
var overlay=new Overlay();
$('button').addEventListener('click',function() {
overlay.open();
$().ajax({
"method" : "get",
"url" : "./data.json",
"data" : {
"name": "gaga",
"age": 10000000,
"num": "12346&598"
},
success:function(res){
console.log(res.code)
},
Error : function(msg){
alert(msg);
},
"async" : true
})
});