N
N
Nikita Lubchich2014-10-30 10:29:09
HTML
Nikita Lubchich, 2014-10-30 10:29:09

Why can't I connect an external template?

I connect the template in the form

<head lang="en">
    <meta charset="UTF-8">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <title>E-Library</title>

    <script type="text/template" id="author-view-template">
        *код шаблона*
    </script>
</head>

Backbone.js handles it normally, but if you do
...
<script type="text/template" id="author-view-template" src="static/templates/author.html"></script>
...

Stops working. The browser loads the page correctly. How should external templates be loaded correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aen, 2014-10-30
@aen

If you want to load templates then use require.js. It has a plugin for loading templates. https://github.com/requirejs/text

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question