0

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();
  • 2
    Post the code here too – Ejaz May 05 '13 at 16:42
  • R u include syntaxhighter js above the shBrushPHP.js – Tamil Selvan C May 05 '13 at 16:46
  • Yes I do, all files are correctly included. –  May 05 '13 at 16:46
  • Can you provide a link to the page that this is happening on? Clearly things are not 'correctly' included, since it's not working; being able to see the page in question will let us help you figure out the problem here. – Dancrumb May 05 '13 at 16:49
  • 1
    @Dancrumb He should include code here to make this question a useful one http://meta.stackexchange.com/questions/125997/something-on-my-web-site-doesnt-work-can-i-just-paste-a-link-to-it – Ejaz May 05 '13 at 16:50

1 Answers1

4

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.

David Hermanns
  • 395
  • 3
  • 12
  • My problem turned out to be referencing the files from the author's host location (http) from my blogger blog (https). So I had to find somewhere to host them from via https. – dudeNumber4 Dec 04 '14 at 18:29