Files
revive/js/examples/web/index.html
T
2024-11-27 15:17:26 +01:00

36 lines
999 B
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Web Worker Example</title>
<style>
/* Ensure the pre tag wraps long lines */
pre {
white-space: pre-wrap; /* Wrap long lines */
word-wrap: break-word; /* Break long words */
max-width: 100%; /* Optional: Ensures it doesn't overflow container */
overflow-wrap: break-word; /* Another method for wrapping */
}
</style>
</head>
<body>
<h1>Revive Compilation Output</h1>
<pre id="output"></pre>
<script>
var outputElement = document.getElementById('output');
var worker = new Worker('./worker.js');
worker.addEventListener('message', function (e) {
const output = e.data.output
outputElement.textContent = output;
}, false);
worker.postMessage({
contractCode: 'contract C { function f() public { } }',
})
</script>
</body>
</html>