Copying from r84906#code-comments,
Since the script at bookmanager.js interacts with the DOM, it should be executed only when document is ready, as in:
$(function() {
//Code goes here...
});
Besides, I think you should replace
if ( $prev[0] ) by if ($prev.length)
if ( $next[0] ) by if ($next.length)
And if would be good idea to add an id for the top navigation and another for the botton, so that $( ' .mw-book-navigation ' ) can be replaced by something like
$( '#some-id-for-top, #some-id-for-bottom' ).find( ' .mw-book-navigation ' )
, which is more efficient. See
[[mw:JavaScript_performance#Selector_performance_.28jQuery.29]]
Version: unspecified
Severity: normal