MathJax HTML component

I am currently trying to set up a HTML component that sends what is typed in (an input box) to a HTML component, and the HTML component converts it into maths symbols using MathJax. My code so far in the HTML component is…

MathJax example

When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

What this does is change the paragraph…

“When (a \ne 0), there are two solutions to (ax^2 + bx + c = 0) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$”

In to…

What I would like to be able to do is to be able to type in the expression/equation into a input box and then this message is posted to the html component and the MathJax script is applied to display the maths correctly.

I understand how to post messages to HTML component, just not sure how to adapt the HTML code.

Thanks

@andreas-kviby … I think you are the person who can help!? : )

It would be nice if someone could reply, stop me from just talking to myself.

Anyway, so far I have written this code in the html component

MathJax example

HTML Label

This works but only very rarely. So if I type in text into my input box, sometimes it coverts it into maths and other times it does not.
Can anyone help please?

any update??

Please add a new post with a link to refer back to this post rather than bumping up an old thread.

Andreas Kviby hasn’t been associated with Wix for a while now, so you won’t get any reply or help from him.

This previous post could add a little bit of info if you have not seen it already.
https://www.wix.com/corvid/forum/community-discussion/how-to-pass-string-with-backslashes-from-backend

Also, you can find more info on the html component here.
https://www.wix.com/corvid/reference/$w.HtmlComponent.html
https://support.wix.com/en/article/corvid-working-with-the-html-element
https://support.wix.com/en/article/using-iframes-to-display-visible-content-on-your-site
https://support.wix.com/en/article/embedding-custom-code-to-your-site

Please note that as stated in the above links, if you use third party provided code then Wix won’t provide support for it.

If you are having issues with third party code, then you should be going through the third parties own support.
http://docs.mathjax.org/en/latest/basic/community.html#mailing-lists
https://groups.google.com/forum/#!forum/mathjax-users

Also, they have their own API that you can look at using instead of html, which you can use with Wix HTTP Functions and/or Wix Fetch. (Although this looks like the API doc is still under construction, so you would need to contact them directly to get more info on the API).
https://docs.mathjax.org/en/latest/api/index.html

https://support.wix.com/en/article/corvid-accessing-third-party-services-with-the-fetch-api
https://www.wix.com/corvid/reference/wix-fetch.html

https://support.wix.com/en/article/corvid-exposing-a-site-api-with-http-functions
https://www.wix.com/corvid/reference/wix-http-functions.html

Wix Examples
https://www.wix.com/corvid/example/exposing-apis
https://www.wix.com/corvid/forum/tips-tutorials-examples/example-myapi-and-myapiclient

You can even see if Wix support their NodeJS in Wix Package Manager as well.
http://docs.mathjax.org/en/latest/index.html#server-nodejs
https://support.wix.com/en/article/corvid-managing-external-code-libraries-npm-with-the-package-manager