I have a Django App that, from a template feed.html
calls different templates for different elements in the data base. The idea is to use a JavaScript script to visualize each one of these elements, the problem is that it just show the last one of them (the last element in this page).
The script is this one:
function showPiece(targ, piece){
window.onload = function(){
Lily.ready({
target: targ, // target div id
file: 'files', // file input id
path: '../../static/js/src', // path to source directory from current html file
});
};
window.onload = function(){
var madeleine = new Madeleine({
target: targ, // target div id
data: piece,
path: '../../static/js/src', // path to source directory from current html file
});
};
};
I am calling the script from the feed.html
file.
<script type="text/javascript" charset="utf-8">
var url_objetivo = '{{ piece.file.url }}'
var id_objetivo = "id-" + {{ piece.id}}
showPiece(id_objetivo, url_objetivo)
</script>
How can I force it to display the information for every element?