I'm trying to use underscore.js template function on the following code based on http://underscorejs.org/#template and other tutorials
json = {"data": [{"img0": "image.jpg"}]}
var compiled = _.template("image: <%= img0 %>");
compiled(json.data[0]);
document.getElementById("albums").innerHTML = compiled();
but i got this error:
Uncaught ReferenceError: img0 is not defined
Can you explain to me what the problem is?