How to properly add inline js? function prospectpicker_unfollow_init() {
drupal_add_js($prospectpicker_unfollow_path . '/js/stickyMojo.js');
drupal_add_js('jQuery(document).ready(function () {
    jQuery("#unfollow-sidebar").stickyMojo({footerID: "#unfollow-footer", contentID:  "#unfollow-content"});
    });', 'inline');
}


I have included a js file named as "stickyMojo.js", and I want to use that js file's function named as stickyMojo, in order to add the sticky sidebar to my form elements.
Just a suggestion.

As hook_init is only called on non-cached page, and you require this JS to be called on every page; why don't you go ahead and add it to your theme's .info file?

scripts[] = js/stickyMojo.js