This my latex code. How to convert this to MATHML code using jQuery, JavaScript or PHP
$${\pi_{ij}}={\rm{R}}SBU_{ij}^L-{\rm{R}}SBU_{ij}^H={q_{ap}}(f_{ij}^L-f_{ij}^H)/{N_{ap}}.$$
Consider using the JavaScript library MathJax (https://www.mathjax.org/)
(A)
<!DOCTYPE html>
<html>
<head>
<title>MathJax TeX Test Page</title>
<script type="text/javascript" async
src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_CHTML">
</script>
</head>
<body>
Your test: $${\pi_{ij}}={\rm{R}}SBU_{ij}^L-{\rm{R}}SBU_{ij}^H={q_{ap}}(f_{ij}^L-f_{ij}^H)/{N_{ap}}.$$
</body>
</html>
(B)
And if you actually need the MathML then mathJax offers that functionality as well as described in their docs
Moreover, if you are already working with NodeJS then you could have a look at MathJax-node as mentioned in another SO question. It allows different input syntax (e.g. TeX) and offers different outputs (e.g. MathML), see their GIT.