Reputation: 5454
I have a handlebars template in a public directory. I'd like to access the contents of this file with JavaScript. Here's the code for the script:
<script id="test_template" type="text/template" src="/templates/test.hbs"></script>
If I dump out the contents of the file inside the script tag (instead of using the "src" attribute) I can easily get at the contents, but then I won't get any caching.
Is it possible to get the contents of this file without using an AJAX call?
Upvotes: 2
Views: 211
Reputation: 11882
Is it possible to get the contents of this file without using an AJAX call?
No, you'll need to use an AJAX call.
Upvotes: 1