-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path23.html
44 lines (38 loc) · 990 Bytes
/
23.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<style type="text/css">
.container{
height:300px;
width:400px;
border:1px solid red;
display:flex;
}
.inner{
border:1px solid black;
flex:1;
}
</style>
<script type="text/javascript">
window.onload= function(){
var btn = document.getElementsByTagName('button')[0];
btn.onclick = function(){
var xhr = new XMLHttpRequest();
console.log('withCredentials' in xhr);
xhr.open('get', 'http://baidu.com', true);
xhr.setRequestHeader('X-Custom-Header', 'value');
xhr.send();
};
};
</script>
<script src="tools.js"></script>
</head>
<body>
<div class="container">
<div class="inner">我是左侧item</div>
<div class="inner">我是右侧的item,我的内容比较多</div>
</div>
<button>请求</button>
</body>
</html>