I have dynamically created images (recorder thumbnails) in javascript. I want to send the image path for this image to another file.
I think I can not get the image ID. I can not go to another file at all. The image is closed.
window.onload = function() {
var message = {id : 'vodList'}
sendMessage(message);
document.getElementById(bb).addEventListener('click', function() { vodPlayer(); });
}
ws.onmessage = function(message) {
for (var i=0; i<parsedMessage2.length; i++){
createImage = document.createElement("img");
createImage.setAttribute('src', parsedMessage2[i].vod_thumbnail);
createImage.setAttribute('alt', '100%x280');
createImage.setAttribute('height', '280px');
createImage.setAttribute('width', '100%');
createImage.setAttribute('id', 'vodThumbnailId');
document.getElementById('vodListId').appendChild(createImage);
vodPath = JSON.stringify(parsedMessage2[i].vod_path);
}
}
function vodPlayer() {
var form = document.createElement('form');
form.setAttribute('charset', 'UTF-8');
form.setAttribute('method', 'Post');
form.setAttribute('action', 'vodPlayer.html');
var hiddenField = document.createElement('input');
hiddenField.setAttribute('type', 'hidden');
hiddenField.setAttribute('name', 'vodPath');
hiddenField.setAttribute('value', vodPath);
form.appendChild(hiddenField);
document.body.appendChild(form);
form.submit();
}
I hope you can help me.