commit ae48b1fd8b39522da40f3b68cb54f335f2028eab
parent d1b0893fec08ead572068100c80bb38b342fd14f
Author: Davide P. Cervone <dpvc@union.edu>
Date: Fri, 23 Dec 2011 10:40:10 -0500
Fix problem with accessing MathInput before it is creatd in MSIE
Diffstat:
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/test/sample-dynamic.html b/test/sample-dynamic.html
@@ -59,17 +59,6 @@ input {margin-top: .7em}
window.UpdateMath = function (TeX) {
QUEUE.Push(HIDEBOX,["Text",math,"\\displaystyle{"+TeX+"}"],SHOWBOX);
}
-
- //
- // IE doesn't fire onchange events for RETURN, so
- // use onkeypress to do a blur (and refocus) to
- // force the onchange to occur
- //
- if (MathJax.Hub.Browser.isMSIE) {
- window.MathInput.onkeypress = function () {
- if (window.event && window.event.keyCode === 13) {this.blur(); this.focus()}
- }
- }
})();
</script>
@@ -83,5 +72,18 @@ Type some \(\rm\TeX\) code and press RETURN:<br />
<div id="MathOutput" class="output">$${}$$</div>
</div>
+<script>
+ //
+ // IE doesn't fire onchange events for RETURN, so
+ // use onkeypress to do a blur (and refocus) to
+ // force the onchange to occur
+ //
+ if (MathJax.Hub.Browser.isMSIE) {
+ MathInput.onkeypress = function () {
+ if (window.event && window.event.keyCode === 13) {this.blur(); this.focus()}
+ }
+ }
+</script>
+
</body>
</html>