-
Notifications
You must be signed in to change notification settings - Fork 0
/
index2.html
82 lines (79 loc) · 1.83 KB
/
index2.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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>URI代码加密解密</title>
<style type="text/css">
#text1 {
background-color: #CCFF00;
height: 53px;
width: 332px;
position: absolute;
left: 318px;
top: 83px;
color: #2AFF55;
}
#text3 {
background-color: #0033CC;
height: 310px;
width: 782px;
position: absolute;
left: 245px;
top: 189px;
color: #2AFF55;
display: none;
text-align: left;
line-height: 0px;
vertical-align: text-top;
}
.text2 {
font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif;
font-size: 36px;
font-style: italic;
font-weight: bold;
color: #3F3;
text-decoration: none;
position: absolute;
left: 338px;
top: 88px;
}
.button {
height: 50px;
width: 100px;
position: absolute;
left: 692px;
top: 87px;
}
.button2 {
height: 50px;
width: 100px;
position: absolute;
left: 823px;
top: 86px;
}
</style>
</head>
<body background="47385.jpg">
<input type="text" class="text1" id="text1" name="text1"/>
<input type="button" class="button" value="URI加密" onclick="encryption();"/>
<input type="button" class="button2" value="URI解密" onclick="deciphering();"/>
<input type="text" class="text3" id="text3" name="text3"/>
<script language="javascript">
function deciphering()
{
var string=document.getElementById('text1').value;
var string2=decodeURI(string);
document.getElementById('text3').value=string2;
document.getElementById('text3').style.display='block';
alert('解密成功:'+string2);
}
function encryption()
{
var string=document.getElementById('text1').value;
var string2=encodeURI(string);
document.getElementById('text3').value=string2;
alert('加密成功:'+string2);
}
</script>
</body>
</html>