in jQuery

Simple jQuery Plugin Example

5. Plug(in) and Play

All that is left to do is add your plugin to your site and to call it. Adding this or any other jQuery plugin to your site is just a matter of linking to the JavaScript file that contains your plugin code.

NB: jQuery plugins must be loaded after the main jQuery file is loaded.

The accepted naming convention for jQuery plugins is jquery.pluginname.js. So for our example we will save our plugin code in a file named jquery.explainify.js and upload it to our site.

Next, we will add the following code to our web page:

<script type="text/javascript" src="/path/to/jquery.js"></script>
<script type="text/javascript"
    src="/path/to/jquery.explainify.js"></script>