How can I have two commands under one <a href>? It’s a MP3 file link; the first one starts playing the song, but on that click I want the page they are on to link to another page too. Thanks.
@ZnupiOct 08.2006 — #Or you could, more easily in my opinion, do something like : [code=php] <a href="javascript: function1(param); function2(); function3(); etc();">Link</a> [/code] Or ... if you want it to look pretty, and not print in the user's status bar all the functions that you call, use : [code=php] <a href="javascript:void(0)" onClick="function1(params); function2(); etc();">Link</a> [/code] I hope this helps...
@jamesx521authorOct 09.2006 — #How should I include [B]target="_blank"[/B] for their MP3 player that will open, yet [B]target="_self"[/B] for the new page; does the code go outside the two (params), or inside?
@NeoboffinOct 09.2006 — #I assumed you had Javascript knowledge. How are you trying to play these mp3 files. Through the user's media players on their desktops or through your web site?
@jamesx521authorOct 10.2006 — #Right now what I have is: [CODE]<a href="test.mp3" target="_blank">[/CODE] so it opens the file in whatever their IE, Mozzila, etc. native-audio-player is. I definitely need the [B]target="_blank"[/B] for the MP3, so that their audio-player doesn't open on the same window as the web page. And with the second [B]href[/B] I want that page to change to another page [B]target="_self"[/B].
@jamesx521authorOct 10.2006 — #I forgot that my link is in an [B]iframe[/B] in the page, so for this part: [CODE]onClick="window.location = 'http://yahoo.com/'[/CODE] I would need to add [B]target="_parent"[/B] somewhere: where? Thanks.
@jamesx521authorOct 10.2006 — #I followed your directions [I]Neoboffin[/I] but it didn't work. I put [B]ID[/B] in the [B]iframe[/B] and used the new [B]onClick[/B] code too. The page doesn't change at all. In the previous version: [B]onClick="window.location = 'http://yahoo.com/';"[/B] the page [U]did[/U] change, except it was in the [B]iframe[/B]. Are there other solutions? Thanks.
@jamesx521authorOct 10.2006 — #That's what I have, except with different names and links. My [B]iframe[/B] is placed within [B]<div></div>[/B]. Would that interfere anyhow?
@jamesx521authorOct 11.2006 — #Do I still need this code in the iframe page: [CODE]<script language="javascript" type="text/javascript"> function letsGo(play, to) { // Your MP3 plyer stuff here.
// Go to link window.location = to; } </script>[/CODE] when I use the two codes below... the first, in the main page that calls the iframe: [CODE]<iframe id="myFrame" width="400" height="400"></iframe>[/CODE] and this second, in the iframe page: [CODE]<a href="my_mp3.mp3" target="blank" onClick="document.getElementById('myFrame').src = 'http://yahoo.com/';">Play MP3</a>[/CODE]