user3580480
user3580480

Reputation: 482

jReject not working on IE6 and IE7

I have configured jReject as per the documentation, it works fine on IE8, IE9, IE10+ etc. But for some reason it does nothing for IE6 and IE7.

I at the moment have it configured to block all browsers, so I am unsure why?

HTML

<head>

<script type="text/javascript">
 document.createElement('header');
 document.createElement('nav');
 document.createElement('menu');
 document.createElement('section');
 document.createElement('article');
 document.createElement('aside');
 document.createElement('footer');
</script>

    <meta charset="utf-8">

    <title>Indigo | Information and Communication Solutions</title>

    <link rel="stylesheet" href="../reset.css">
    <link rel="stylesheet" href="../style.css">
    <link rel="stylesheet" href="../animations.css">
    <link rel="stylesheet" type="text/css" href="../jquery.reject.css" />

    <script type="text/javascript" src="../jquery-1.6.1.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
    <script type="text/javascript" src="custom.js"></script>
    <!-- jReject -->    
    <script type="text/javascript" src="../jquery.reject.js"></script>
    <script type="text/javascript"> 

    $(function() {
    $.reject({
         reject: {
             safari: true, // Apple Safari
             chrome: true, // Google Chrome
             firefox:false, firefox1: true, firefox2: true , // Mozilla Firefox
             msie: true, // Microsoft Internet Explorer
             opera: true, // Opera
             konqueror: true, // Konqueror (Linux)
             unknown: true // Everything else
         }
     }); //
});
</script>
</head>

jquery,reject.js

(function($) {
$.reject = function(options) {
    var opts = $.extend(true, {
        // Specifies which browsers/versions will be blocked
        reject : {
            all: true, // Covers Everything (Nothing blocked)
            msie: 6 // Covers MSIE <= 6 (Blocked by default)

Any help greatly appreciated.

Thanks,

UPDATE:

Interestingly it doesn't even work if I run the demo's from the official site. http://jreject.turnwheel.com/

...so guess the issue is not specific to my code. I wonder if this could be a browserstack issue?

Upvotes: 0

Views: 551

Answers (1)

aidan hamade
aidan hamade

Reputation: 11

It looks like there is a problem in jReject on line 40:

        chrome: {
            // Text below the icon
            text: 'Google Chrome',
            // URL For icon/text link
            url: 'http://www.google.com/chrome/', *** REMOVE THIS COMMA ***
            // (Optional) Use "allow" to customized when to show this option
            // Example: to show chrome only for IE users
            // allow: { all: false, msie: true }
        },

It appears there is an extra comma which throws a JavaScript error in older versions of IE.

Checkout some more discussions on this here:

Does Internet Explorer 9 choke on extra commas at the end of array and object literals?

Upvotes: 1

Related Questions