Monday, March 6, 2017

underscore template javascript query function

How do you query your data with javascript, I have a helper javascript file but I can't use it in my template it throws an error saying herlper is not defined.

Example code:

<img alt="" src="<%= helper.isURL(images[i].small) ? images[i].small : '/img/' + images[i].small %>">

I tried embedding some raw javascript block with isURL but I still get the same error how do get around this

<script>function isURL() {}</script>



via ONYX

Advertisement