Logic Ali answered my previous question about how to send a link from one iframe to another:
Now I would like to put it into a function. This is what I've come up with:
And then in my image map:
It doesn't work. I tried putting the whole thing in the getplaylist var and the alert returned the entire thing correctly. But it didn't start the media player. So I moved it around the way it is now. It still doesn't work. Any ideas as to what I'm doing wrong?
Thanks
Code:
<a href="music/playlist.m3u" onclick="parent.document.getElementById('iframe1'
).contentWindow.PlayM3u(this.href);return false">test</a>
Code:
function Play(){
var file = location.href.substring(location.href.lastIndexOf('/')+1);
var fileName =file.split('.',1);
var getplaylist = [fileName] + "/" + 'playlist.m3u';
'[getplaylist] onclick="parent.document.getElementById("iframe1").contentWindow.PlayM3u(this.href);return false"';
alert(getplaylist);
}
Code:
<area shape="rect" coords="0,0,268,268" href="javascript:Play()">
Thanks
Comment