That's pretty non-standard code. Without some initialization it would probably give you a 404 not found when you clicked on that link.
So, either you made a typo copying it, and/or there was some problem with the editor, or we need to see more code. I suspect it should be:
Code:
<a href="javascript:parent.iframe.EP_addTracks('ep_pla . . .
If so, when you open the pop up, it should be via the window.open() method, something like:
Code:
<a href="player.html" onclick="window.open(this.href, '_blank'); return false;">Player</a>
You should assign it to a global variable, player here. Also include some specifications to prevent it from opening in a new tab:
Code:
<a href="player.html" onclick="player = window.open(this.href, '_blank', 'width=300, height=200'); return false;">Player</a>
Now you can do:
Code:
<a href="javascript:player.EP_addTracks('ep_player1', '<track><location>mp3/welcome.mp3</location><title>Added to begin.</title><creator>Track</creator></track>', 0);">add track to begin</a>
This assumes that the EP_addTracks() function is on player.html and that the path to the mp3 specified is valid for player.html.
If the window hasn't been opened yet, there will be an error. There are various ways to check for that.
I'd think something like:
Code:
<a href="javascript:if(typeof player !== 'undefined' && typeof player.EP_addTracks === 'function')player.EP_addTracks('ep_player1', '<track><location>mp3/welcome.mp3</location><title>Added to begin.</title><creator>Track</creator></track>', 0);else alert('You Need to Open the Player');">add track to begin</a>
Bookmarks