Here is my code:
Template = {
create_progress_div : function(uniqueIdentifier){
document.getElementById('modal-content').innerHTML = '';
document.getElementById('modal-content').innerHTML = ''+
'<div class="pi-flow-file">'+
'<label name="pi-flow-text">'+uniqueIdentifier+'</label>'+
'<progress name="pi-flow-bar" id="'+uniqueIdentifier+'" max="100" value="0"></progress>'+
'<div name="pi-flow-action" nowrap="nowrap">'+
'<button href="#" onclick="API.upload_to_ad('+uniqueIdentifier+')">'+
'<img src="js/flow/resume.png" title="Resume upload" />'+
'</button>'+
'</div>'+
'</div>';
},
}
As you can imagine, with my API.upload_to_ad() function, I am getting a <uniqueIdentifier-string> is undefined.
I need to pass uniqueIdentifier as a string rather than an identifier for this to work.
How do I do this?
= ''+ '<div class="pi-flow-file">'?? Why the''if you are just going to concatenate another string?uniqueIdentiferinto your string properly. The real question is have you checked thatuniqueIdentifieris actually being passed?''add to the readability? Your adding more concatenation that doesn't need to be there.document.getElementById('modal-content').innerHTML = '';just prior to the next line that resets theinnerHTMLanyway?