-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
48 lines (41 loc) · 882 Bytes
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>toURI() Test Page</title>
<style>
body, input {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px;
}
.block {
display: block;
margin: .5em auto;
padding: 4px 10px;
text-align: left;
width: 600px;
}
</style>
</head>
<body>
<h1 class="block">toURI() Test Page</h1>
<center>
<input type="text" id="text" onkeyup="checkURI(); return false;" size="100" class="block">
<p id="result" class="block"></p>
</center>
<script src="toURI.js"></script>
<script>
var text = document.getElementById('text'),
result = document.getElementById('result');
window.checkURI = function (e) {
if (e) {
e.stopPropagation();
}
console.log(' > ', text.value);
result.innerHTML = toURI(text.value || '');
return false;
};
text.focus();
</script>
</body>
</html>