blob: e6aed30f673bf56a825a2441f515b1f8d05eab75 (
plain)
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
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Prototype Console</title>
<script src="../dist/prototype.js" type="text/javascript"></script>
<script type="text/javascript">
function test() {
var out = $('out');
try {
input = $F('input');
out.innerHTML += input.escapeHTML() + '<br />';
value = eval(input);
out.innerHTML += '=> ' + value.toString().escapeHTML() + '<br />';
} catch (e) {
out.innerHTML += 'Error: ' + e.toString().escapeHTML() + '<br />';
}
$('input').value = '';
}
</script>
</head>
<body>
<form onsubmit="test(); return false">
<input type="text" size="60" id="input" />
<input type="submit" value="Execute" />
</form>
<div id="test"></div>
<div id="out"></div>
</body>
</html>
|