Skip to content

Instantly share code, notes, and snippets.

@guyht
Created December 30, 2011 19:24
Show Gist options
  • Save guyht/1541123 to your computer and use it in GitHub Desktop.
Save guyht/1541123 to your computer and use it in GitHub Desktop.
function init() {
document.parser = new Worker('https://raw.github.com/guyht/Giki/master/lib/gworker.js');
document.parser.onerror = function(event){
throw new Error(event.message + " (" + event.filename + ":" + event.lineno + ")");
};
document.parser.onmessage = function(event) {
document.getElementById('wiki_div').innerHTML = event.data;
};
document.parser.postMessage(document.getElementById('wiki_textarea').value);
}
function parse(obj) {
document.parser.postMessage(obj.value);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment