I'm using a Javascript library called MathJax which allows you to use LaTex and other mathematic markup languages like it in HTML. I'm trying to use it in Javascript but the regular expressions are getting in the way. Here is my code:
function sendTex()
{
var latexStuff = $("#texField").val();
var latexString = "When $a \ne 0$, there are two solutions to \*(ax^2 + bx + c = 0\*) and they are
$$x = {-b \pm \qrt{b^2-4ac} \over 2a}.$$";
$("#texVersion").append(latexString);
}