BorisMoore / jsrender

A lightweight, powerful and highly extensible templating engine. In the browser or on Node.js, with or without jQuery.
http://www.jsviews.com
MIT License
2.67k stars 339 forks source link

Prevent loading resource in template #347

Closed Jogai closed 5 years ago

Jogai commented 5 years ago

When I have a template in my html like this:

<script type="text/x-jsrender" id="photoTemplate">
    <figure>
        <img src="/PhotoPath/{{: Name}}?preset=AlbumCoverThumb" alt="{{: Description }}" class="img-responsive img-thumbnail" />
        <figcaption>{{: Name}}</figcaption>
    </figure>
</script>

There is always a request going to something like /PhotoPath/%7B%7B:%20Name%7D%7D

Is there something I can do to prevent this from happening?

BorisMoore commented 5 years ago

That should not happen. It works for me. If you can't figure it out, create a jsfiddle showing the issue, and I'll take a look.

Jogai commented 5 years ago

Sorry, you're right. I'm using another component which depends on jsrender so I should check better where the issue originates.

My test case for the interested: https://codepen.io/jogai/pen/NJYrZB