I have a client that has 15 unique movies, each must be dynamically loaded into an iframe created within the webinar page using the click of a text-link. I am trying to use the onclick event, but when multiple movies are listed, the code wants to load only the first movie listed. The code for a single movie currently looks like...
Code:
<script type="text/javascript">
function load(file){
var iframeTag = document.getElementById('frame');
var body = document.getElementsByTagName('body').item(0);
var myiframe = document.getElementById('myiframe');
if(iframeTag) body.removeChild(iframeTag);
iframe = document.createElement('iframe');
iframe.src = file;
iframe.id = 'frame';
iframe.width = '960px';
iframe.height = '720px';
iframe.frameborder = '0';
iframe.scrolling = 'no';
myiframe.appendChild(iframe);
}
</script>
<a onclick="load('unique movie url'); return false">Load Movie </a></p>
How can I configure the code so that I will have 15 separate "Load Movie" links, each able to load its own unique movie into the iframe that is generated? Similarly, I would guess I would need to "unload" previous movie urls before another one could be loaded???
Thanks in advance for any help you can offer...I am stumped.