Menu

[3e9889]: / python / index.html  Maximize  Restore  History

Download this file

41 lines (37 with data), 1.2 kB

 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
<!DOCTYPE html>
<html>
<head>
<title>Empythoned</title>
<script>
function start() {
var input = document.getElementById('input')
, output = document.getElementById('output')
, button = document.getElementById('button')
, worker = new Worker('worker.js')
, loaded = false
, handler = function (e) {
if (!loaded) {
loaded = true;
button.value = "Execute";
input.disabled = false;
button.disabled = false;
return;
}
output.value += e.data;
};
worker.addEventListener('message', handler, false);
button.onclick = function() {
worker.postMessage(input.value);
};
};
window.onload = start;
</script>
</head>
<body>
<h1>Empythoned Demo</h1>
<textarea disabled="true" id="input" style="font-family: monospace; width: 80%" rows="8">print 'Hello World'</textarea>
<input disabled="true" id="button" type="button" value="loading........." style="display: block; margin: auto" />
<textarea id="output" style="font-family: monospace; width: 80%" rows="8"></textarea>
<hr>
</body>
</html>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.