User:Pavel92/vector.js

var x = 0; // A global variable, because it is not in any function addOnloadHook(function f{ var z = 'foxes', r = 'birds'; // 2 local variables  m = fish; // global because it wasn't declared anywhere before  function child  {     var r = 'monkeys'; // This variable is local and does not affect the "birds" r of the parent function.     z = 'penguins'; // The child function is able to access the variables of the parent function, this is called closure.  }  twenty = 20; // This variable is declared on the next line, but usable anywhere in the function, even before, as here  var twenty;  child;  return x; // We can use x here because it is global } );

// Qwikify addOnloadHook(   function  {         addTab("javascript:doQwikify", "wikify", "ca-wikify", "Mark for wikification");    } ); function doQwikify { document.editform.wpTextbox1.value = "{" + "{wikify}}\n\n" + document.editform.wpTextbox1.value; document.editform.submit; }