admin管理员组文章数量:1398771
I am just following the instruction over here and its not working any help?
<script type="text/javascript" src="sh/src/shCore.js"></script>
<script type="text/javascript" src="sh/scripts/shBrushJScript.js"></script>
<link href="sh/styles/shCore.css" rel="stylesheet" type="text/css" />
<!--<link href="sh/styles/shCoreDefault.css" rel="stylesheet" type="text/css" />-->
<link href="sh/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
<pre class="brush: js">
/**
* SyntaxHighlighter
*/
function foo()
{
if (counter <= 10)
return;
// it works!
}
</pre>
<script type="text/javascript">
SyntaxHighlighter.all()
</script>
Found some error in console don't know wt to do with it.
Uncaught ReferenceError: XRegExp is not defined shCore.js:123 Uncaught TypeError: Cannot read property 'Highlighter' of undefined shBrushJScript.js:45 Uncaught TypeError: Cannot read property 'all' of undefined test.php:21 Attr.specified is deprecated. Its value is always true.
I am just following the instruction over here and its not working any help?
<script type="text/javascript" src="sh/src/shCore.js"></script>
<script type="text/javascript" src="sh/scripts/shBrushJScript.js"></script>
<link href="sh/styles/shCore.css" rel="stylesheet" type="text/css" />
<!--<link href="sh/styles/shCoreDefault.css" rel="stylesheet" type="text/css" />-->
<link href="sh/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
<pre class="brush: js">
/**
* SyntaxHighlighter
*/
function foo()
{
if (counter <= 10)
return;
// it works!
}
</pre>
<script type="text/javascript">
SyntaxHighlighter.all()
</script>
Found some error in console don't know wt to do with it.
Uncaught ReferenceError: XRegExp is not defined shCore.js:123 Uncaught TypeError: Cannot read property 'Highlighter' of undefined shBrushJScript.js:45 Uncaught TypeError: Cannot read property 'all' of undefined test.php:21 Attr.specified is deprecated. Its value is always true.
Share Improve this question edited May 21, 2014 at 6:00 Skyyy asked May 21, 2014 at 5:53 SkyyySkyyy 1,5692 gold badges24 silver badges61 bronze badges 3- Have you tried the web developer toolbar? Any errors in the JavaScript console here? – ConcurrentHashMap Commented May 21, 2014 at 5:57
- Updated question with errors – Skyyy Commented May 21, 2014 at 6:02
-
@SkyKumar You're acessing the first file using
sh/src/shCore.js
and the scond usingsh/scripts/shBrushJScript.js
, I think they should be in the same directory. – SeinopSys Commented May 21, 2014 at 6:17
2 Answers
Reset to default 2I found this LINK
Try to keep all your local files for syntax highliter in same directory like this:
<script type="text/javascript" src="sh/src/shCore.js"></script>
<script type="text/javascript" src="sh/src/shBrushJScript.js"></script>
OR
<script type="text/javascript" src="sh/scripts/shCore.js"></script>
<script type="text/javascript" src="sh/scripts/shBrushJScript.js"></script>
I quickly made a simple html site to check your problem and it works for me:
<html>
<head>
<link href="http://alexgorbatchev./pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css" />
<script src="http://alexgorbatchev./pub/sh/current/scripts/shCore.js" type="text/javascript"></script>
<script src="http://alexgorbatchev./pub/sh/current/scripts/shBrushJScript.js" type="text/javascript"></script>
<link href="http://alexgorbatchev./pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css" />
</head>
<body>
<pre class="brush: js">
/**
* SyntaxHighlighter
*/
function foo()
{
if (counter <= 10)
return;
// it works!
}
</pre>
<script type="text/javascript">
SyntaxHighlighter.all()
</script>
</body>
</html>
So I'm pretty sure, you're having some referencing issue as the files in the <script>
tag are not correctly referencing the local files. Try again with the remote files offered by the author of the script. Does it work then?
本文标签: javascriptSyntax highlighter not workingStack Overflow
版权声明:本文标题:javascript - Syntax highlighter not working - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744721608a2621730.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论