Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7709835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:57:43+00:00 2026-06-01T00:57:43+00:00

I really love SyntaxHighter – it turns out the poshest looking code around. Unfortunately

  • 0

I really love SyntaxHighter – it turns out the poshest looking code around. Unfortunately I’ve barked my shins against an appalling JS error in IE7 and IE8 which is going to prevent me using this otherwise excellent plugin altogether.

Here’s a test case. I’m including

<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>

in my header so IE7 and IE8 can recognise HTML5 elements.

In the body of my test page I’ve just got a few nav items:

<nav id="top-nav" class="f16 clearfix">
    <ul id="nav-menu">
        <li><a href="index.htm">Home</a></li>
        <li><a href="branding.htm">Branding</a>
            <ul class="nav-submenu">
                <li><a href="logos1">Logos 1</a></li>
                <li><a href="logos2">Logos 2</a></li>
                <li><a href="logos3">Logos 3</a></li>
            </ul>
        </li>
    </ul>
</nav>

There’s nothing else apart from these includes for JQuery and SyntaxHighlighter, and this little script which initialises SyntaxHighlighter and tries to add an event listener to the nav menu.

<script src="extra/syntax-highlighter/shCore.js"></script>
<script src="extra/syntax-highlighter/shBrushJScript.js"></script>
<script src="extra/syntax-highlighter/shBrushXml.js"></script>
<script>
    SyntaxHighlighter.all();

    $(document).ready(function(){
        $('#nav-menu').on('mouseenter', function () {
            $(this).children('.nav-submenu').fadeIn('fast');
        })
    })
</script>

When I view this page in IE7 and IE8 I get the error “SCRIPT5007: Unable to get value of the property ‘slice’: object is null or undefined” and my jQuery fails to work.

From reading around I understand this may have something to do with XRegExp, which SyntaxHighlighter uses. According to this jQuery bug ticket there was some error in XRegExp which was fixed in XRegExp 1.5.1. Unfortunately this fix doesn’t seem to have found its way to SyntaxHighlighter. There was a discussion of a similar bug on SyntaxHighlighter’s Bitbucket page. I tried the modified XregExp.js and shCore.js files one guy produced, but it didn’t fix my problem.

Has anyone else come across this kind of thing? Otherwise I’ll have to use some other crappy syntax highlighter!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T00:57:45+00:00Added an answer on June 1, 2026 at 12:57 am

    I was having the same issues in IE7/8

    I finally fixed them by grabbing the latest version of the plugin from GitHub (https://github.com/alexgorbatchev/SyntaxHighlighter) which is more up to date than the repository on BitBucket.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really love shrinking my code into as few lines as possible. I have
I don't really love when the code in the page is written in one
I'm starting to play out with socket.io and I would really love to see
I really love the one model in - one model out idea of Fubu
I really love the philosophy of chaining methods, like jQuery emphasys in its library.
I really love the way Ajax makes a web app perform more like a
i really love the jquery validation plugins, look neat stylish and accessible, but as
I really love working with Django and Python, when I go back to PHP
I really love org-mode in emacs and want to customize a few things. While
I would really love to push for TDD development inside the shop I'm working

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.