Results 1 to 5 of 5
  1. #1
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default Can you see any problem?

    Well the error is in... Internet Explorer - How surprising!

    Well this works perfectly fine in Firefox, but Internet Explorer is having none of it.

    The error in IE is:

    document.getElementById(...) is null or not an object

    My radio player code is:
    HTML Code:
    <object classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" name="player" width="167" height="40" standby="Loading" codebase="http://www.habbcrazy.net/CODEBASE=http:/activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715">
        <param name="player" id="radio_player" url="http://www.habbcrazy.net" value="true" />
        <param name="CONTROLS" value="Imagewindow" />
        <param name="ShowStatusBar" value="false" />
        <param name="src" id="radio_src" value="http://habbcrazy.net:8002/" />
        <param name="url" id="radio_url" value="http://habbcrazy.net:8002/" />
        <param name="autostart" value="true" />
        <param name="autoplay" value="true" />
        <param name="Controls" value="playbutton" />
        <param name="uimode" value="mini" />
        <embed id="radio_embed" src="http://www.habbcrazy.net/pages/radio/mediafile.asx" showstatusbar="false" controls="playbutton" autostart="True" width="167" height="40" autostart="True" controls="playbutton" showstatusbar="false" url="http://www.habbcrazy.net/pages/radio/mediafile.asx" showstatusbar="false" controls="playbutton" autostart="True" autoplay="true" uimode="mini" />
    </object>
    My Javascript code is:

    Code:
                function refresh_radioplayer()
                {
                    document.getElementById('radio_src').value = "http://habbcrazy.net:8002/";
                    document.getElementById('radio_url').value = "http://habbcrazy.net:8002/";
                    
                    document.getElementById('radio_embed').src = "http://www.habbcrazy.net/pages/radio/mediafile.asx";
                    document.getElementById('radio_embed').url = "http://www.habbcrazy.net/pages/radio/mediafile.asx";
                }
    As you can see, all the ids exist :S

  2. #2
    Join Date
    Nov 2007
    Location
    London
    Posts
    1,577
    Tokens
    36

    Latest Awards:

    Default

    Get code from http://tech-hosts.co.uk/player and change the source. That works in firefox and internet explorer (asx source required for it to work in firefox).
    Kind Regards,

    Guy
    __________________

    Since 2007. Unbelievable Uptime. Web hosting, resellers, master resellers, linux VPS, windows VPS, shoutcasts, at the lowest prices on the net.
    Tech-Hosts.co.uk.


  3. #3
    Join Date
    Jul 2008
    Location
    Hastings, UK.
    Posts
    2,050
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by iUnknown View Post
    Get code from http://tech-hosts.co.uk/player and change the source. That works in firefox and internet explorer (asx source required for it to work in firefox).
    He's making a javascript refresh function, not using another player.

    Alternatively, I think you could do something with the browser, because I can't spot anything wrong with the code. Something to detect what browser and just do a normal refresh if IE? or just do that completely, lol?

  4. #4
    Join Date
    Apr 2005
    Posts
    4,614
    Tokens
    1,290

    Latest Awards:

    Default

    IE uses the <object> bit and FF uses the <embed> bit and only <embed> has the ID radio_embed

  5. #5
    Join Date
    May 2006
    Location
    Hull
    Posts
    7,701
    Tokens
    2,430
    Habbo
    Moh

    Latest Awards:

    Default

    I found out the reason. Internet Explorer likes to do its own thing and ignore ids on objects.

    I had to add an id to the object tag (player), and use the following javascript code:

    Code:
                function refresh_radioplayer()
                {
                    if(navigator.appName == "Microsoft Internet Explorer") {
                    
                        document.getElementById('player').src = "http://habbcrazy.net:8002/";
                        document.getElementById('player').url = "http://habbcrazy.net:8002/";
                        
                    } else {
                        
                        document.getElementById('radio_src').value = "http://habbcrazy.net:8002/";
                        document.getElementById('radio_url').value = "http://habbcrazy.net:8002/";                
                        document.getElementById('radio_embed').src = "http://www.habbcrazy.net/pages/radio/mediafile.asx";
                        document.getElementById('radio_embed').url = "http://www.habbcrazy.net/pages/radio/mediafile.asx";
                        
                    }
                }

Posting Permissions

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