MathML polyfill
Purpose
MathML enables the display of mathematical formulas. Because some browsers do not support this functionality natively, this polyfill emulates the same functionality using MathJax.
Known issues
- Browsers that lack both MathML and SVG support (e.g., IE8 - IE9) will take longer to load MathML than browsers with either SVG or MathML support
- IE8 takes a lot longer to load MathML than IE9 (known MathJax reflow issue)
- Pages with a lot of complex formulas can take a few minutes to load on slow machines running IE8 (known MathJax issue)
Working example
How to implement
To use the polyfill, standard MathML is required. In cases where a browser doesn't support MathML, the polyfill is automatically loaded.
Configuration options
Configuration options available for MathML (MathML 3.0 specification)
Events
Event | Trigger | What it does |
---|---|---|
wb-init.wb-math (v4.0.5+) |
Triggered manually (e.g., $( "math" ).trigger( "wb-init.wb-math" ); ). |
Used to manually initialize the MathML polyfill. Note: The MathML polyfill will be initialized automatically unless the math element is added after the page has already loaded. |
wb-ready.wb-math (v4.0.5+) |
Triggered automatically after the MathML polyfill initializes. Note: This event will only be triggered if the polyfill is loaded. The polyfill will not load for browsers with adequate native MathML support. | Used to identify when the MathML polyfill initializes (target of the event)
|
wb-ready.wb (v4.0.5+) |
Triggered automatically when WET has finished loading and executing. | Used to identify when all WET plugins and polyfills have finished loading and executing.
|
Source code
MathML polyfill source code on GitHub (also in wb.js)
- Date modified: