admin管理员组文章数量:1278886
Hope you can help me with ReferenceError: prettyPrint is not defined
.
<a class="question helpcenterheading" href="">How do I contact you?</a>
<span class="answer">One moment...</span>
<script>
$(document).ready(function() {
$("span.answer").hide();
$("a.question").click(function() {
$(this).toggleClass("active").next().slideToggle(2000, function() {
window.location.href = $(this).attr('href');
});
return false;
});
});
</script>
(live version)
Hope you can help me with ReferenceError: prettyPrint is not defined
.
<a class="question helpcenterheading" href="http://www.google.">How do I contact you?</a>
<span class="answer">One moment...</span>
<script>
$(document).ready(function() {
$("span.answer").hide();
$("a.question").click(function() {
$(this).toggleClass("active").next().slideToggle(2000, function() {
window.location.href = $(this).attr('href');
});
return false;
});
});
</script>
(live version)
Share Improve this question edited May 31, 2014 at 14:55 Barmar 782k56 gold badges546 silver badges660 bronze badges asked May 31, 2014 at 14:48 user2439720user2439720 212 silver badges3 bronze badges2 Answers
Reset to default 7According to the Documentation there are two ways to run Prettify:
1) The auto-loader run_prettify.js
. This doesn't require you to call any functions, you can specify some parameters in the URL.
2) Serving your own JS and CSS, by loading prettify.css
and prettify.js
. Then you need to use <body onload="prettyPrint()">
.
I think you're using the auto-loader, and then trying to call prettyPrint()
. Pick one or the other method, you can't mix them.
You have
<body onload="prettyPrint()">
But prettyPrint is never defined
本文标签: javascriptReferenceError prettyPrint is not defined errorStack Overflow
版权声明:本文标题:javascript - ReferenceError: prettyPrint is not defined error - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741278799a2369887.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论