locked
'SyntaxHighlighter.config' is null or not an object RRS feed

  • Question

  • User-1973986724 posted

    Hi,

    I have found this plugin that can highlight code that you insert in tinyMCE. On this URL:
    http://www.3ntar.net/articles/e4c4dbac- … 50f5f.aspx

    Now I get this error for this script below that I wonder why I get this and what I need to add etc to make it work?

    Message: 'SyntaxHighlighter.config' is null or not an object

    <script type="text/javascript">
        var SyntaxHighlighter;
            SyntaxHighlighter.config.clipboardSwf = "~/jscripts/tiny_mce/plugins/icode/Javascript/clipboard.swf";  
            SyntaxHighlighter.all();  
    </script>
    
    Monday, February 28, 2011 8:23 PM

All replies

  • User1415119982 posted

    Please remove this line from your javascript

    var SyntaxHighlighter;

     

    You are actually trying override the SyntaxHighlighter global variable. I guess it's supposed to be created by SyntaxHighlighter api.

     

    Monday, February 28, 2011 11:33 PM
  • User-1973986724 posted

    I tried without var SyntaxHighlighter from the beginning but did put it if that was the problem.

    The thing is as I discovered now is that this code works locally on my computer but not on the server. So I beleive my question is what the problem could be then?

     

     <script type="text/javascript">
         SyntaxHighlighter.config.clipboardSwf = "jscripts/tiny_mce/plugins/icode/Javascript/clipboard.swf";
         SyntaxHighlighter.all();  
    </script>
    Tuesday, March 1, 2011 10:26 AM