Support » Plugin: SyntaxHighlighter Evolved » [Plugin: SyntaxHighlighter Evolved] undefined variables error

  • Resolved computerslayer1


    In IE6, two undefined variable errors make the entire page go blank. Normally I wouldn’t care about minor issues in IE6, but the page is completely inaccessible in IE6 because of this error.

    line 27
    error: 'SyntaxHighlighter' is undefined
    code: 0
    line 423
    error: 'SyntaxHighlighter' is undefined
    code: 0

    Line 63 just indicates some HTML which doesn’t appear to be at all related to the syntax highlighter (an H3 tag).

    At line 786 is this line:
    SyntaxHighlighter.config.strings.expandSource = '+ expand source';

    Below is the entire code block for the syntax highlighter as it appears in IE6:

    <script type='text/javascript' src='http://localhost/wpsite/content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shCore.js?ver=3.0.83c'></script>
    <script type='text/javascript' src='http://localhost/wpsite/content/plugins/syntaxhighlighter/syntaxhighlighter3/scripts/shBrushPlain.js?ver=3.0.83c'></script>
    <script type='text/javascript'>
    		var corecss = document.createElement('link');
    		var themecss = document.createElement('link');
    		var corecssurl = "http://localhost/wpsite/content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shCore.css?ver=3.0.83c";
    		if ( corecss.setAttribute ) {
    				corecss.setAttribute( "rel", "stylesheet" );
    				corecss.setAttribute( "type", "text/css" );
    				corecss.setAttribute( "href", corecssurl );
    		} else {
    				corecss.rel = "stylesheet";
    				corecss.href = corecssurl;
    		document.getElementsByTagName("head")[0].insertBefore( corecss, document.getElementById("syntaxhighlighteranchor") );
    		var themecssurl = "http://localhost/wpsite/content/plugins/syntaxhighlighter/syntaxhighlighter3/styles/shThemeDefault.css?ver=3.0.83c";
    		if ( themecss.setAttribute ) {
    				themecss.setAttribute( "rel", "stylesheet" );
    				themecss.setAttribute( "type", "text/css" );
    				themecss.setAttribute( "href", themecssurl );
    		} else {
    				themecss.rel = "stylesheet";
    				themecss.href = themecssurl;
    		document.getElementsByTagName("head")[0].insertBefore( themecss, document.getElementById("syntaxhighlighteranchor") );
    	SyntaxHighlighter.config.strings.expandSource = '+ expand source'; = '?';
    	SyntaxHighlighter.config.strings.alert = 'SyntaxHighlighter\n\n';
    	SyntaxHighlighter.config.strings.noBrush = 'Can\'t find brush for: ';
    	SyntaxHighlighter.config.strings.brushNotHtmlScript = 'Brush wasn\'t configured for html-script option: ';
    	SyntaxHighlighter.defaults['pad-line-numbers'] = false;
    	SyntaxHighlighter.defaults['toolbar'] = false;

Viewing 1 replies (of 1 total)
  • After digging into this further, it seems that in the template’s head, a script tag with a src attribute wasn’t properly closed. IE6 was the only browser that caused a fit with this.

    Problem solved.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: SyntaxHighlighter Evolved] undefined variables error’ is closed to new replies.