blueimp/JavaScript-Templates

TypeError: o.files is undefined

Closed this issue · 1 comments

hello,,
i have this error in the console.. What i am trying to do is that get the uploaded files from the database and i want to give them to the template engine to build up the download template. Here is the code:

$('.files').html(tmpl("template-download",jsn));

here is a sample of my json string:

[
{
name:"asasdjhgdsjgasdh.jpg",
thumbnail_url:"http://localhost/.....jpg",
url:"http://localhost/........pg",
type:"jpg",
size:"270 mb",
delete_url:"http://localhost/...../UploadHandler.ashx"
},
..
..
..
etc
]

thanks in advance :)

problem solved like this :)

function buildOldFiles(jsn) {
var temp = tmpl("template-download");
var result = temp({files: jsn});
$('.files').html(result);
}

thanks