container.getElementsByTagName is not a function
container.getElementsByTagName is not a function var collection = container.getElementsByTagName(tagName);
Well, that looks like a valid function for a DOM element so why would it not be defined? This error is occurring on line 2155 of ASCIIMathML.js (2.0.2) in the function called
getElementsByClass(). This function takes three parameters,
clsName. So I set a break point and check some of the parameters. Right away I see that the
container parameter is actually being given a string that actually looks like a class name. Until recently, browsers didn’t supply a native
getElementsByClass() function so libraries that needed it provided their own implementation. It seems this implementation is overriding another implementation that does take the class name as a first parameter instead of a DOM element.
ASCIIMathML.js actually only calls this function twice so I opted for the simple solution of find/replace in ASCIIMathML.js and renamed the function to something simple like amGetElementsByClass(). With that change, the error is gone and my toolbar is back.
getElementsByClassName() method supported by Firefox 3 and up, IE9 (not 7 or 8!) Safari, Chrome and Opera.