Difference between revisions of "MediaWiki:Gadget-SearchFocus.js"

From Department of Theoretical and Applied Mechanics
Jump to: navigation, search
(Created page with "// Imported from http://en.wikipedia.org/wiki/MediaWiki:Gadget-searchFocus.js as of June 4, 2009 if ( wgPageName == 'Main_Page' || typeof( wgMainPageTitle ) != 'undefined' &...")
 
(No difference)

Latest revision as of 12:09, 12 February 2015

// Imported from http://en.wikipedia.org/wiki/MediaWiki:Gadget-searchFocus.js as of June 4, 2009
if (
	wgPageName == 'Main_Page' ||
	typeof( wgMainPageTitle ) != 'undefined' && wgPageName == wgMainPageTitle
)
{
	addOnloadHook( function() {
		document.getElementById( 'searchInput' ).focus();
	});
}