I have the following Javascript/Jquery code:
<script type="text/javascript">
function ChangeMathOnPage() {
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
}
$('.markdownx-preview').each(function(){
$(this).on('DOMSubtreeModified', ChangeMathOnPage);
});
</script>
This does my job. However, as explained here, use of DOMSubtreeModified is deprecated.
To somebody new to Javascript/Jquery world, please explain ways to convert same logic into non-deprecated code.