【发布时间】:2014-11-26 10:31:41
【问题描述】:
我在我的页面中使用syntaxhighlighter,效果很好。
<pre id="code" class="brush:js">
some code here
</pre>
但是当我保存到一个 html 文件然后使用 jquery 加载函数来加载它们时它不起作用。
$(function(){
$("#code").load("test.html");
});
除了代码范围外,一切都显示得很好。有人能告诉我为什么吗?谢谢!
我想通了,解决办法是:
$(function(){
$("#code").load("test.html", function(){
SyntaxHighlighter.highlight();
});
});
【问题讨论】:
-
test.html 中有什么? #测试是什么?请为您的问题添加更多信息
-
jquery load issue的可能重复
标签: javascript jquery syntaxhighlighter