I just want to do something like this:
contentAsync.load("linear_regression", new AsyncCallback<String>() {
public void onFailure(Throwable caught) {
content.add(new HTML("<h1>FAIL</h1>something went wrong"));
caught.printStackTrace();
}
public void onSuccess(String result) {
// after the RPC new mathematical equations were added to the web content
// so now I invoke the JavaScript function 'testFunc' on the client.
MainLayout.jsniAlert("testFunc");
}
});
The JavaScript part:
<script type="text/javascript">
function testFunc() {
alert('huhu');
MathJax.... <--! reload page -->
}
</script>
I just need to know if and how it is possible to tell MathJax to reload the page .. I couldn't find an example that does that. I already tried
MathJax.Hub.Process();
MathJax.Hub.Update();
MathJax.Hub.Reprocess();
MathJax.Hub.Rerender();
But no call did what I hoped it would do. Thanks for any help
From the MathJax documentation:
To queue the typeset action, use the command
MathJax.Hub.Queue(["Typeset",MathJax.Hub]);
This will cause MathJax to typeset the page when it is next able to do so. It guarantees that the typesetting will synchronize properly with the loading of jax, extensions, fonts, stylesheets, and other asynchronous activity, and is the only truly safe way to ask MathJax to process additional material.
The MathJax.Hub.Typeset() command also accepts a parameter that is a DOM element whose content is to be typeset. That could be a paragraph, or a element, or even a MathJax math tag. It could also be the DOM id of such an object, in which case, MathJax will look up the DOM element for you. So
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"MathExample"]);
would typeset the mathematics contained in the element whose id is MathExample.