Hide/Show function does not work in IE 8

Asked

Viewed 205 times

1

I have a Javascript that makes the function of grouping items in a table.

For example I click on it and it expands bringing more values of this item. The problem is that in IE 8 does not work. In Chrome and Mozilla the function works normally.

function ocultarColunasNaoAgrupadas(){
    $('#tabelaPainelCnab tbody tr td').each(function() {
        var idCell = $(this).attr('name');

        if (idCell == 'identQuebraMes') {
            var cellTextMes = ''+ $(this).html();
        }     
        if (idCell == 'identQuebraCarteira') {
            if ($(this).html().length > 0 ) {
                $(this).closest('tr').attr('agrupador', 'N');
                //$(this).closest('tr').slideToggle(300)
                $(this).closest('tr').hide();
            } else { 
                $(this).closest('tr').hide();
                $(this).closest('tr').attr('agrupador', 'S');
                $(this).closest('tr').attr('class', 'header');
                $(this).closest('tr').show();
            }  
        }
    });
}
  • It would be good to specify which version of IE. A formatted code would also not hurt =)

  • I’m learning how to use the stack, forgive me the mistakes, version of IE 8, thanks for the tips.

  • Note that I have 3 questions, please answer them all: 1. Is there an error in the IE8 console? 2. What version of jQuery are you using? 3. You can post a simplified structure of the HTML part?

  • Good evening Guilherme, no error occurs in IE8, Versao Jquery-1.6.2.js, Follows code here https://paste.ofcode.org/h7D5652nR2A2ignaCvHG4t

1 answer

1

Current jQuery not IE 8 Support

Supported browsers

Desktop

Chrome: (Current - 1) and Current
Edge: (Current - 1) and Current
Firefox: (Current - 1) and Current
Internet Explorer: 9+
Safari: (Current - 1) and Current
Opera: Current

Mobile

Stock browser on Android 4.0+
Safari on iOS 7+

Solution

If you need support for older browsers like Internet Explorer 6-8, Opera 12.1x or Safari 5.1+, use jQuery 1.12

Conditional comments

 <!--[if IE 8]>
<script src="js/jQuery-1.12.js"></script>
<![endif]-->

source: http://jquery.com/browser-support/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.