# LaTeX rendering deferred poorly

The bookmarklet that is used to display MathJax in chat uses the Ajax "complete" event to know when to render the page contents.

Recently, it has been noted that new $\LaTeX$ does not get rendered unless the user enters a comment themselves or runs the bookmarklet again. Has something changed with regard to the way Ajax events are presented to chat?

• I'm not entirely sure whether this should be a (bug) or a (support). Question: is the AJAX behaviour on Chat actually documented somewhere? If yes and disagrees with what you see, then I would agree with (bug). Otherwise I can't really see it as a bug per se when one uses non-documented features on a website and changes break it. – Willie Wong Feb 22 '12 at 9:30
• @Willie: Whether bug or support, those who use the bookmarklet would like to get it working as it did before. – robjohn Feb 22 '12 at 12:47
• if it is a bug, then SE should fix it. If it is not a bug, the author (which I guess is you?) of the bookmarklet should fix it. While the end result is the same, a (bug) says to me "change it back so you don't break X" whereas a (support) says to me "can you figure out what I need to do to fix X". We all know what happens when a company bends over backwards to support compatibility that depends on undocumented behaviour. – Willie Wong Feb 22 '12 at 13:26
• Are we seeing the same thing? When I use the bookmarklet, and type something in math, it looks like that after the send, the $...$ gets processed, and then over-written again by the unprocessed version. I wonder if there are actually two separate issues there. – Willie Wong Feb 22 '12 at 13:53
• @Willie: That is what I see when I enter LaTeX. When someone else enters LaTeX, I see only the unprocessed version. If I run the bookmark again, then the LaTeX is processed. – robjohn Feb 22 '12 at 20:43
• @Willie: I understand that working from undocumented features is transitory at best. However, the bookmark seemed the only way to bring MathJax to the chat since there seemed to be very little other progress on this front. From what Zhen Lin said in his comment to my post regarding the bookmark, I had thought the automatic update code was based on standard events generated by Ajax. – robjohn Feb 22 '12 at 20:54
• @Willie: I modified the bookmarklet from this blog to incorporate more features of MathJax, and then added the code suggested in this comment by Zhen Lin. However, I would be glad to modify the bookmark if that is the best place to fix this. If so, I would gladly accept any support from the developers I can get. – robjohn Feb 22 '12 at 21:00
• I hope the devs can help; my knowledge of AJAX is limited. BTW, thank you again for writing the script. "One click away" is better than nothing! – Willie Wong Feb 23 '12 at 8:59