To add a script to the site, use the following command:
$this->headScript()->appendFile('/js/script.js', 'text/javascript');
And when it comes to testing the site, this appears:
<script type="text/javascript" src="/js/script.js"></script>
But it does not load the script, in the browser console it appears:
Uncaught SyntaxError: Unexpected token
And the contents of the file /js/script.js is the main page.
<!doctype html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>Inicio -
I do not know why it does not load the js file, I'm using Zend Framework 1.12.0