我正在尝试用Mathquill做一些简单的静态格式化。当我测试我的代码时,文本没有格式化,也没有任何错误让我知道我是否做错了什么。
<html>
<head>
<style>
<link rel="stylesheet" href="dist/mathquill/mathquill.css"/>
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="dist/mathquill/mathquill.js"></script>
<script>
var MQ = MathQuill.getInterface(2);
var problemSpan = document.getElementById('problem');
MQ.StaticMath(problemSpan);
</script>
</head>
<body>
<p>Solve <span id="problem">ax^2 + bx + c = 0</span>.</p>
</body>
</html>所有路径都是正确的,因为没有404错误。

发布于 2020-05-12 00:41:49
不需要样式标签,并且会干扰链接标签。需要等待DOM就绪。
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mathquill/0.10.1/mathquill.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathquill/0.10.1/mathquill.js"></script>
<script>
window.addEventListener('DOMContentLoaded', () => {
var MQ = MathQuill.getInterface(2);
var problemSpan = document.getElementById('problem');
MQ.StaticMath(problemSpan);
});
</script>
</head>
<body>
<p>Solve <span id="problem">ax^2 + bx + c = 0</span>.</p>
</body>
</html>
https://stackoverflow.com/questions/61734179
复制相似问题