Does someone know how? Css/javascript alert doesnt work below version Internet Explorer 9

75 views Asked by At

i have this code :

var div = document.createElement("div");
div.innerHTML = "<!--[if lt IE 10]><i></i><![endif]-->";
var isIeLessThan10 = (div.getElementsByTagName("i").length == 1);
if (isIeLessThan10) {
    alert("Update Internet Explorer or use Microsoft Edge, Google Chrome, Mozilla Firefox, Opera!");
}

That i use for the jQuery plugin jReject. That alert box message works with all versions below explorer 10. But when i merged the jReject plugin in there it only pops up with explorer 9.

It seems like javascript and css doesn't work. And i need it for if clients still use windows xp with an old browser.

This is how my code looks now.

<script type="text/javascript" src="script/jquery.js"></script>
    <script type="text/javascript" src="script/jquery.cookie.js"></script>
        <script type="text/javascript" src="script/jquery.reject.js"></script>
    <script type="text/javascript">


            var div = document.createElement("div");
div.innerHTML = "<!--[if lt IE 10]><i></i><![endif]-->";
var isIeLessThan10 = (div.getElementsByTagName("i").length == 1);
if (isIeLessThan10) {



            $(function() {
        // Handle external links


        // Handle displaying of option links
        $('em.option').css({
            cursor: 'pointer',
            fontSize: '1.1em',
            color: '#333',
            letterSpacing: '1px',
            borderBottom: '1px dashed #BBB'
        }).click(function() {
            var self = $(this);
            var opt = $.trim(self.text());

            $('ol.dp-c:first').children('li').children('span').each(function() {
                var self = $(this);
                var text = self.text();
                var srch = opt+':';

                // If found, highlight and jump window to position on page
                if (text.search(srch) !== -1) {
                    self.css('color','red');
                    window.location.hash = '#c-'+opt;
                    window.scrollTo(0,self[0].offsetTop);
                }
            });
        });





    $.reject({  
        reject: { all: true }, // Reject all renderers for demo  
        close: false, // Prevent closing of window  
        paragraph1: '', // Warning about closing  
        paragraph2: ''  
    });  

    return false;  

                });
    }



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

Plugin link: https://github.com/TurnWheel/jReject

My question is how i need to change my css and or javascript so that i will also be shown in internet explorer 8 and below? If it even accepts javascript.

You can see on my website www.gester.nl in the internet explorer version 9 emulator

0

There are 0 answers