User:Crausch/common.js

// Create portlet link var portletLink = mw.util.addPortletLink( 'p-cactions', '#',       'My new portlet link', 'ca-my-portlet', 'Click here to test the new portlet' ); // Bind click handler $( portletLink ).click( function ( e ) {       e.preventDefault;        // doSomeStuff;        alert( 'It works!' ); });