Hi some time ago i posted a thread here but never got resolved, sorry if i trouble you people, pls don't flame.
i've been working alot on the site but just can't seem to get this bloody script to work, and my JavaScript knowledge is below basics :S
i got this script that is for loading the HTML tag <anchor>(<a>) in a MediaPlayer on the site.
right now, when the function init() gets activated it works just fine. only problem is that when i wanna surf to other pages the function init stays active and the urls gets send to the mediaplayer.
javascript
maybe the problem would be fixed if document.getElementsByTagName ('a');Code:function init () { var x = document.getElementsByTagName ('a'); for (i = 0; i < x.length; i++) { x[i].onclick = function () { document.getElementById('media').innerHTML = "<embed type='application/x-mplayer2' id='music2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/' src='"+ this.href +"' name='MediaPlayer1' width='217' height='84' controltype='1' showcontrols='1' showstatusbar='0' AutoStart='true'></embed> "; return false; } } }
only works when the anchor has some type of name/title in it something like <a name="RadioA" href="mms://strm-4.us.medianova.tv/KRALFM_64?MSWMExt=.asf"> i honestly don't know :S
pls help you will have my eternal grattitude
i don't know if i am allowed to post the site what im trying to fix, so i'll post it when asked for![]()



.
Reply With Quote


Bookmarks