Jump to content

User:Addshore/functions.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by TheDJ (talk | contribs) at 08:02, 24 April 2013 (document.write is evil). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//include_js function (might be used in here somewhere)
function include_js(includedscript) 
{
  var i;
  if (include_js.arguments.length>0) 
  {
    importScript( 'User: + includedscript + '.js' );
    i=1;
    while (i < include_js.arguments.length)
    {
      if (typeof(include_js.arguments[i]) == "string" )
      {
        i++;
        if (i < include_js.arguments.length)
        {
          window[include_js.arguments[i-1]] = include_js.arguments[i];
          i++;
        } else {
          alert ("Variable "+ include_js.arguments[i-1] +" specified, but no value provided."); return; 
        } 
      } else {
          alert ("Bad name for variable"); return;
      }
    }
  } else { 
    alert ("No script name provided."); 
  }
}

//JSlauncher function (might be used in here somewhere)
function JSlauncher()
{
if (location.href.indexOf('&JScript=') != -1)
  {
  var target = location.href.split('&JScript=')[1];
  location.href = "javascript:" + target;
  }
}