Making Mathjax dynamic so it renders input without page refresh

I use the Simple Mathjax plugin on my Wordpress site to allow users to add nicely formatted mathematics by writing it within dollar signs, $...$ or $$...$$.

This works on pages and in posts but not in chat windows.

After reading much documentation and searching for answers to my issue, I found out that the MathJax script is run at onload of the page itself. So, after page refresh. Then all $...$ $$...$$ occurrences are formatted nicely.

But I need the MathJax rendered dynamically, so it will appear nicely formatted when posted as a message in a chat without requiring a page refresh.

As far as I can see in the MathJax documentation, there is a Typeset command that should make dynamic math formatting possible with a line like:
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);