Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Cmd-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (Cmd-Shift-R on a Mac)
- Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Clear the cache in Tools → Preferences
For details and instructions about other browsers, see Wikipedia:Bypass your cache.
Code that you insert on this page could contain malicious content capable of compromising your account. If you are unsure whether code you are adding to this page is safe, you can ask at the central discussion page, Scriptorium. The code will be executed when previewing this page under some skins, including Monobook. You can in the interim if you wish to refresh the content sooner under another skin. |
Documentation for this script can be added at User:EnDumEn/doublepage. |
var xmlhttp;
function compare(url) {
if (window.XMLHttpRequest) {
xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=xmlhttpChange;
xmlhttp.open("GET", url, true);
xmlhttp.send(null);
}
}
function xmlhttpChange() {
if (xmlhttp.readyState==4) {
if (xmlhttp.status==200) {
var content = document.getElementById('content');
var table = document.createElement('table');
var tr = document.createElement('tr');
tr.setAttribute('valign', 'top');
var td = document.createElement('td');
td.setAttribute('width', '50%');
var bodycontent = document.getElementById('bodyContent');
td.appendChild(bodycontent);
tr.appendChild(td);
td = document.createElement('t');
td.setAttribute('width', '50%');
var viewdiv = document.createElement('div');
viewdiv.innerHTML = xmlhttp.responseText.match("<!-- start content -->(.|\n)*<!-- end content -->");
td.appendChild(viewdiv);
tr.appendChild(td);
table.appendChild(tr);
content.appendChild(table);
} else {
alert("Problem retrieving XML data" + xmlhttp.status);
}
}
}
/* add form */
function addcompareform() {
var form = document.createElement('form');
form.setAttribute('id', 'compareForm');
var inp = document.createElement('input');
inp.setAttribute('id', 'compareInput');
inp.setAttribute('type', 'text');
form.appendChild(inp);
inp = document.createElement('input');
inp.setAttribute('id', 'compareButton');
inp.setAttribute('type', 'button');
inp.setAttribute('value', 'show');
inp.onclick = function() { compare("http://en.wikisource.org/wiki/"
+ document.getElementById('compareInput').value) };
form.appendChild(inp);
var tabs = document.getElementById('contentSub');
tabs.appendChild(form);
}
if (window.addEventListener) window.addEventListener("load",addcompareform,false);
else if (window.attachEvent) window.attachEvent("onload",addcompareform);