You have to "hide" the template or it will be evaluated by the browser. Wrap it in a fake script tag:
```php
<script id="addressBookConfigTemplate" class="hidden" type="text/template">
<div id="addressbooks-ui-div" title="Add new addressbook" class="addressbooks-ui-class">
...
</div>
```
The `type="text/template"` will prevent it from being evaluated by the JS engine.