There's a wealth of information available there if you want it. But if all you want is the number of the division, replace all this:
Code:
<script>
var total = <?php echo $i; ?>;
$(function () {
'use strict';
for(var i=0;i<=total;i++){
// Initialize the jQuery File Upload widget:
//$('#container #fileuploaddiv_'+i).fileupload();
$('#container #fileuploaddiv_'+i).fileupload({
//var num = i;
change: function (e, data) {
$.each(data.files, function (index, file) {
//alert('Selected file: ' + file.name);
//alert(file.name);
//alert($(this).parents('div[class="fileuploadclass"]').attr('id'));
//alert($(this).parent().parent().parent().parent().parent().parent().parent().parent().find('div[type=id]').attr());
//$('div.fileupload-content').find('tr[class=template-download]').remove();
//$('#container #fileuploaddiv_' + e).find('tr[class=template-download]').remove();
});
}
});
}//loop
});
</script>
with:
Code:
<script>
$(function () {
$('.fileuploadclass').fileupload({
change: function () {
alert(this.id.replace(/\D/g, ''));
}
});
});
</script>
Bookmarks