User:Iggyvolz/global.js

function getUrlVars { var vars = {}; var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi, function(m,key,value) {       vars[key] = value;    }); return vars; } // Script from http://papermashup.com/read-url-get-variables-withjavascript/ var action = getUrlVars["action"]; var preview = getUrlVars["preview"]; var text = getUrlVars["text"]; if(action=="edit") { if(preview=="true") { document.getElementById("wpTextbox1").innerHTML=text; } }