Mathjax being loaded even there are no math equations

15 views
Skip to first unread message

Ramakrishna Salagrama

unread,
May 22, 2017, 8:17:45 AM5/22/17
to MathJax Users
Hi, 

Mathjax is being loaded even there are no math equations. 

The following page is being tested : www.campusgate.co.in/p/placement-papers.html


Is there anyway we can stop loading this code as it is delaying loading. 

Regards, 
Ramakrishna

Joseph Rex

unread,
May 22, 2017, 9:00:40 AM5/22/17
to MathJax Users
Hi Ramakrishna,

That's the way http works. If you load a library it gets loaded whether or not you are using it. What you could do to circumvent this is Look through the DOM to see if you have any math then load it. If you use mathML then you can try to dynamically load mathML if document.querySelectorAll('math').length > 0 . But I've never done this and don't know if there are caveats to loading mathjax dynamically. It's really not so large if you cover all other performance measures so I let it load on all my pages. Another option could be to let it load async with the async attribute on the <script> tag.
Reply all
Reply to author
Forward
0 new messages