MediaWiki:IframeTest1

function appendNum{var e=document.getElementById("output");e.textContent+=""+(new Date).getTime%10}function eraseNum{var e=document.getElementById("output");var t=e.textContent;var n=t.length;if(t.length>0){e.textContent=t.substring(0,n-1)}}function receiveMessage(e){console.log(e.origin);var t=e.data;switch(t){case"massAppend":for(var n=0;n<10;n++){appendNum}break;case"massErase":for(var n=0;n<10;n++){eraseNum}break;default:console.log("The following message was received, but we don't know how to process it - sorry.\n",t)}e.source.postMessage("We processed your request!",e.origin)}window.addEventListener("message",receiveMessage,false) appendNum eraseNum 