问题
I have included the following on my html page:
<link rel="stylesheet" href="../css/jqmath-0.4.3.css">
<script src="../js/jquery-1.12.1.min.js"></script>
<script src="../js/jqmath-etc-0.4.3.min.js"></script>
<script>M.MathPlayer = false; M.trustHtml = true;</script>
But when the page loads i see the following error in Javascript console:
jqmath-etc-0.4.3.min.js:3 Uncaught SyntaxError: Invalid regular
expression: /(\d+\.?\d*|\.\d+)|[\\`]([A-Za-z]+|.)|[�-�][�-�]|
\S[Ì€-ͯ᷀-á·¿âƒ-âƒ¿ï¸ -︯]*/: Range out of order in character class
I am using jqmath-etc-0.4.3.min.js with jquery-1.12.1.min.js.
What am i missing here or could this be a version incompatibility issue?
jqmath 0.4.3 is the only version that seems to be available.
回答1:
Change your second <script>
element to:
<script src="../js/jqmath-etc-0.4.3.min.js" charset="utf-8"></script>
As alljamin suggests, you'll see basically this in COPY-ME.html. The key is the charset="utf-8"
, required if you don't have a <meta charset="utf-8">
in your html file (but you probably really should).
回答2:
I was getting the same error as you did with your code.
If you download jqMath and open the COPY_ME.html
in the downloaded folder, you should be able to see the structure of the html
and how to make changes to it. Everything works fine there.
The example provided on jqMath official website uses jQuery 1.4.3 and your example uses jQuery 1.12.1, I am not sure but that could be the issue.
I hope this helps.
来源:https://stackoverflow.com/questions/36526435/jqmath-not-loading-correctly