Answered by:
Can you please help me with invoking script in sample?

Question
-
I am trying to create an equation editor. Using mathjax, I followed the instructions from the following thread.
I'm trying to use the c# sample
https://code.msdn.microsoft.com/windowsapps/XAML-WebView-control-sample-58ad63f7
I'm trying to use #5 to invoke script.
I have the shrunken folder MathJax included in the solution.
https://dl.dropboxusercontent.com/u/34225393/MathJax.zip
Say I have the following sample html.
<html>
<head>
<title>MathJax AsciiMath Test Page</title>
<script src='ms-appx-web:///MathJax/unpacked/MathJax.js?config=default' type='text/javascript'>
function dosomething() {
window.processMath = function (id) {
MathJax.Hub.Queue(["Typeset", MathJax.Hub,
document.getElementById(id)]);
};
processMath("mymathcontent");}
</script>
</head>
<body><div id="mymathcontent">
LaTeX:
<span class="dynamic_content">
$$J_\alpha(x) = \sum\limits_{m=0}^\infty \frac{(-1)^m}{m! \,
\Gamma(m + \alpha + 1)}
{\left({\frac{x}{2}}\right)}^{2 m + \alpha}$$
</span>
</div>
</body>
</html>It's not working. How do I make this work?
Added by edit: Updated.
After playing around a little with the code, in the sample everytime I load HTML, it always come out as error. What do I need to make the mathjax .js file work?
- Edited by RandyPete Sunday, December 21, 2014 6:08 AM
Saturday, December 20, 2014 6:32 PM
Answers
-
Update on this.
Well, I got it working. Turns out for c# for some reason reducing the size of the folder doesn't work. Doing what the linked website said to do to reduce the size of the javascript folder apparently got rid of some files that were necessary.
I'll have to figure out for myself which files are necessary and which files are disposable. This will be an arduous task...
- Marked as answer by RandyPete Monday, December 22, 2014 8:25 AM
Monday, December 22, 2014 7:46 AM
All replies
-
Hi RandyPete,
Try to remove the ms-appx-web from the script src, use something like below:
<script src='MathJax/unpacked/MathJax.js?config=default' type='text/javascript'>
--JamesWe are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Monday, December 22, 2014 5:15 AMModerator -
Hi RandyPete,
Try to remove the ms-appx-web from the script src, use something like below:
<script src='MathJax/unpacked/MathJax.js?config=default' type='text/javascript'>
--James
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.
This does nothing.Monday, December 22, 2014 6:38 AM -
Update on this.
Well, I got it working. Turns out for c# for some reason reducing the size of the folder doesn't work. Doing what the linked website said to do to reduce the size of the javascript folder apparently got rid of some files that were necessary.
I'll have to figure out for myself which files are necessary and which files are disposable. This will be an arduous task...
- Marked as answer by RandyPete Monday, December 22, 2014 8:25 AM
Monday, December 22, 2014 7:46 AM