1

问题是,我正在使用 angularjs ng-include 加载部分,如果我把 mathquill 框放在部分中

<script src="/MathQuill/mathquill.js"></script>

在局部视图中,它工作正常,但我会收到警告:

Synchronous XMLHttpRequest on the main thread is deprecated because of its   detrimental effects to the end user's experience. For more help, check http://xhr.spec.whatwg.org/.

如果我把

<script src="/MathQuill/mathquill.js"></script>

在主视图中,加载部分后,mathquill 根本不起作用,这是渲染问题吗?如何重新渲染局部视图?或者如果不是,我该如何解决?

4

1 回答 1

0

在 mathquill 网站上找到:

请注意,对于文档就绪时不在 HTML DOM 中的动态创建的元素,您需要在插入可见的 HTML DOM 后调用我们的 jQuery 插件:

$('<span>x^2</span>').appendTo('body').mathquill() or .mathquill('editable')
于 2015-01-29T20:02:51.043 回答