User:Whiteknight/codeviewer.js

var BookName, BookNameE; var gml_xmlhttp; var res;

function WKPrepPV(form) { BookName = form.WKPVBookName.value; if(BookName == "") { return; } BookNameE = BookName.replace(" ", "_"); res = document.getElementById('WKViewerResults'); if(res) { gml_xmlhttp = HTTPClient; if (!gml_xmlhttp) { alert("xml thingy does not work"); return; }   gml_xmlhttp.open("GET", "http://en.wikibooks.org/w/index.php?title=" + BookNameE +                            "&action=raw", true); gml_xmlhttp.onreadystatechange = WKPrepPV2; gml_xmlhttp.send(null); } else { alert("No WKViewerResults element!"); } }

function WKPrepPV2 { if (gml_xmlhttp.readyState != 4) { return; } var xml = gml_xmlhttp.responseText.replace(/" + xml + " "; } }

function WKCreatePVForm { var form_span = document.getElementById('WKViewerForm'); if (form_span) { form_span.innerHTML = "" + "Enter the name of a book to get: " + " " + ""; } }

$(WKCreatePVForm);