$doc->addScriptDeclaration($content, $type = 'text/javascript') adds a script to the page, while $doc->addScript($url, $type = "text/javascript", $defer = false, $async = false); adds a linked script. This is what you should use - $doc->addScript(JURI::base().'components/com_mouse/js/compo_js.js');
You can use the addScriptDeclaration() method but then you should assign $content your full script. Ex: $content = "(function ($) { // all your other js stuff here }).(jQuery)"; This is sometimes useful but be careful with quoting.