MediaWiki:Common.js: Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
m (fixing code)
m (second fix. Should work now.)
Line 4: Line 4:
{
{
   var script  = document.createElement( 'script' );
   var script  = document.createElement( 'script' );
   script.src  = '/index.php?title=User:Poke/CollapsibleTables.js&action=raw&ctype=text/javascript';
   script.src  = '/w/index.php?title=User:Poke/CollapsibleTables.js&action=raw&ctype=text/javascript';
   script.type = 'text/javascript';
   script.type = 'text/javascript';
   document.getElementsByTagName( 'head' )[0].appendChild( script );
   document.getElementsByTagName( 'head' )[0].appendChild( script );

Revision as of 11:35, 1 August 2008

/* Any JavaScript here will be loaded for all users on every page load. */

if ( wgIsArticle || window.location.href.indexOf( 'action=submit' ) > -1 )
{
  var script  = document.createElement( 'script' );
  script.src  = '/w/index.php?title=User:Poke/CollapsibleTables.js&action=raw&ctype=text/javascript';
  script.type = 'text/javascript';
  document.getElementsByTagName( 'head' )[0].appendChild( script );
  
  hookEvent( 'load', function()
  { new CollapsibleTables(); } );
}