0

I am using SyntaxHighlighter. I followed the installation steps and I'm receiving a few errors in the firebug console:

TypeError: SyntaxHighlighter is null

ReferenceError: XRegExp is not defined

I imported the necessary files.

Markup

enter image description here

Why I am getting these errors?

P.Brian.Mackey
  • 43,228
  • 68
  • 238
  • 348
  • 1
    Sounds like you need to put your XRegExp.js reference before the shCore.js reference. But, really, it's hard to tell without more detail. – mafafu Mar 20 '13 at 19:38
  • @mafafu - Yes that answered it. I moved the import of XRegExp.js above ShCore.js and it works now. I was under the impression that the order of imports does not matter in javascript. Can you explain why this resolved the problem? – P.Brian.Mackey Mar 20 '13 at 19:41
  • Order does matter when there's a dependency. One of the most common examples being that you have to load jQuery before you can use jQueryUI. – mafafu Mar 21 '13 at 11:21
  • @mafafu - ok. Well you answered the question so if u want to post these as an answer I will give you answer credit. Thanks! – P.Brian.Mackey Mar 21 '13 at 13:08
  • Alright, glad I could help. I combined the two comments for the answer, in case it helps someone else in the future. – mafafu Mar 21 '13 at 13:54

1 Answers1

1

It sounds like you need to put your XRegExp.js reference before the shCore.js reference. Order does matter when there's a dependency. One of the most common examples being that you have to load jQuery before you can use jQueryUI.

mafafu
  • 1,226
  • 1
  • 17
  • 22