User:Prahlad balaji/My First JavaScript Module.js

// Qwikify $(document).ready( function {	   MODULE_CODE; } ); // Make sure the utilities module is loaded (will load if not already) mw.loader.using( 'mediawiki.util', function {      // Wait for the page to be parsed      $(document).ready( function { // see below "Portlets" subsection var link = mw.util.addPortletLink( 'p-cactions', '#', 'Wikify', 'Mark for wikification'); $( link ).click( function ( event ) {     	       	event.preventDefault;      	       	doQuikify;       } ); } ); } ); document.editform.wpTextbox1.value = "{" + "{wikify}}\n\n" + document.editform.wpTextbox1.value; function doQwikify { document.editform.wpTextbox1.value = "{" + "{wikify}}\n\n" + document.editform.wpTextbox1.value; document.editform.submit; } // Define our main function function myScript { // ... code ... };

// Schelude it to run after the HTML page is parsed $( document ).ready( myScript );

// This shorthand is also valid jQuery( myScript );

$( document ).ready( function {	// ... code ... } );

// Or jQuery( function {	// ... code ... } );