user2235728
user2235728

Reputation:

SyntaxHighlighter is not defined

I am trying to integrate this SyntaxHighlighter to my website. I included all files exactly how in the example, but it does not work.

When I take a look at the web concole it says

ReferenceError: SyntaxHighlighter is not defined @ shBrushPhp.js:81

shBrushPhp.js is part of the files i had to include and I wounder why it does not work. Any ideas?

It would also help if you could say me where SyntaxHighlighter is normally defined.

The line where the error occurrs:

Brush.prototype = new SyntaxHighlighter.Highlighter();

Upvotes: 0

Views: 9880

Answers (1)

David Hermanns
David Hermanns

Reputation: 395

It's a pity, that the interrogator didnt follow the answers to his questions. So the question is still open and we have wether a link nor a code snippet.

At least i had the same error ("SyntaxHighlighter is not defined") and i solved it with bringing my script-tags into the correct order. So make sure you import both javascript files (shCore.js and shBrushJScript.js) in the right order:

<script type="text/javascript" src="js/shCore.js"></script>
<script type="text/javascript" src="css/shBrushJScript.js"></script>

You can see that in the SyntaxHighlighter website you have linked to.

The SyntaxHighlighter object is initialized when running through the shBrushJScript.js. So at this point the SyntaxHightlighter - defined in shCore.js - have to be known. If the SyntagHighlighter is announced later in the code, shBrushJScript does not know it.

Upvotes: 4

Related Questions