4

I am having an issue with using SlimScroll with IE9. It seems to work in all other browsers but IE9. Googling round theres a few different possibilities of the issue but I am really not sure. I cannot see why this wouldn't work especially as it seems to work in the older IE browsers. The easiest way to see the error is to go to: http://rocha.la/jQuery-slimScroll.

Error: Object doesn't support property or method 'slimScroll'

Code around the area:

jQuery(document).ready(function($) {
$('#slimtest1').slimScroll({
height: '200px'
});

My jQuery knowledge is sub-par but from what I can tell this is likely to be an issue with IE9 and jQuery. How I would go about resolving this, I have no clue. Any help would be greatly appreciated.

1 Answer 1

3

Do you have this problem locally on by visiting the slimScroll website ?

I get the same error actually when I visit the site with IE9. Looking at the console there is this message:

SEC7112: Script from https://raw.github.com/rochal/jQuery-slimScroll/master/slimScroll.js was blocked due to mime type mismatch 

The javascript file is indeed included in the html like this:

<script type="text/javascript" src="https://raw.github.com/rochal/jQuery-slimScroll/master/slimScroll.js"></script>

In Chrome, looking at the Network tab of the console, you can see the script is sent from gitHub with "text/plain" MIME type, I guess this is what IE9 complaints about:

enter image description here

The file is transfered from GitHub with a wrong MIME type and IE considers this as a security problem and does not download the script. So when the plugin is not initialized and a call to $(...).slimScrol() raises an error.

If you download the package and try it locally it works nice in IE9.

Anyway, i don't think it is a good idea to reference files from GitHub directly ast GH is not a CDN but a source code repository.

1
  • Brilliant, this was exactly the issue and it seems that the developer has also noticed and fixed the issue already. Thanks once again!
    – Piercy
    Jan 16, 2012 at 11:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.