Results 1 to 4 of 4

Thread: need help with Js and html anchor tags

  1. #1
    Join Date
    Dec 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default need help with Js and html anchor tags

    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
    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;
    				}
    			}
    		}
    maybe the problem would be fixed if document.getElementsByTagName ('a');
    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

  2. #2
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    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
    Please post a link to the page on your site that contains the problematic script so we can check it out.



    -magicyte

  3. #3
    Join Date
    Dec 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    kewl thnx,
    the site is in a another language so sorry about that
    www.turkiyem.fm/test

    you have on the left side a box called "en cok dinlenen" and in a div i have the function put in <div "links_favoryradyo" onMouseove="init()">

  4. #4
    Join Date
    Dec 2008
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    resolved the problem by not using the javascript but making a new page and using PHP $_GET, thnx enyways

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •