Javascript examples for jQuery:Plugin
Jquery simple plugin definition
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-compat-git.js"></script> <script type="text/javascript"> $(window).on('load', function() { (function($) {/*from www . j a v a2 s. c o m*/ $.fn.alertme=function(){ console.log('just testing'); }; }(jQuery)); $(document).ready( function() { $(document).alertme(); }); }); </script> </head> <body> </body> </html>