These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:11 pm Advanced search

Internet Explorer doesn't know getElementById

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

Internet Explorer doesn't know getElementById

Postby Mongole » Mon Sep 13, 2010 9:33 am

Hi.
I'm trying to program a small game with HTML5 and Javascript.
I've used excanvas.js to support canvas for IE and canvas_text.js to support some features of text on canvas for IE.So normally it should work with IE.
But when I want to use my audioloop in JS with

Code: Select all
document.getElementById('cyclemusic').addEventListener('ended', function(){                   //+++++++++++++für IE auskommentieren
                                                                                                        //+++++++++++++für IE auskommentieren
      this.currentTime = 0;                                                                           //+++++++++++++für IE auskommentieren
    }, false);


to manipulate this element from my html-file


Code: Select all
<audio id="cyclemusic" autoplay>
        <source src="in_the_house.ogg">  <!--Firefox-->
        <source src="in_the_house.wav">  <!--IE-->
        <source src="in_the_house.mp3"><!--safari-->
</audio>


I get the following report
Image[/img]
So if anyone knows what to do please help me.
Mongole
<h6>
 
Posts: 2
Joined: Mon Sep 13, 2010 9:02 am

Postby Mongole » Mon Sep 13, 2010 9:34 am

The error message points back to the getElementById-Code I've posted before.
Mongole
<h6>
 
Posts: 2
Joined: Mon Sep 13, 2010 9:02 am

Postby zcorpan » Mon Sep 13, 2010 8:23 pm

Which version of IE?
zcorpan
<article>
 
Posts: 807
Joined: Tue Feb 06, 2007 8:29 pm
Location: Sweden

Postby JAB Creations » Tue Sep 14, 2010 2:52 am

IE does stupid stuff but I'm 200% certain that the problem you are having is not what you think it is.

Break out IE8 and run the developer tools script debugger. 90% of the time an IE 5-6-7 bug will be caught by IE8, if not drop the browser mode from IE8 standards to IE7 standards.

IE 5.0 understands working with ID's and the only really horrible bug that IE 5.0+ has (besides all the proprietary junk) is that it does not work with getelementsbytagname.
User avatar
JAB Creations
<aside>
 
Posts: 566
Joined: Tue Mar 13, 2007 4:48 am
Location: Sarasota Florida, USA


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 2 guests