2 Replies Latest reply: Apr 24, 2012 1:48 AM by vincentccw RSS

    Conditional Statements in IE6 error?

    vincentccw Community Member

      http://mcec.my/

       

      I have added a conditional statement which only target IE6 to render specific css and javascript,

      all other browsers, IE7 and above will use back the general set of css and js...

      However when I preview in IE 6 and IE7 i got the conditional statement render out :

       

      ////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////

      <head>

      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

      <title>Malaysia-China Entrepreneur Conference 2012</title>

       

       

      <!--[if !IE6]>-->

                <link href="include/reset.css" rel="stylesheet" type="text/css" />

          <link href="include/style.css" rel="stylesheet" type="text/css" />

         

          <link rel="stylesheet" href="include/coin-slider-styles.css" type="text/css" />

          <script type="text/javascript" src="include/jquery-1.7.2.min.js"></script>

          <script type="text/javascript" src="include/coin-slider.min.js"></script>

         

          <script type="text/javascript" src="include/bw-menu.js"></script>

      <!--<![end if]>-->

       

       

      <!--[if gte IE7]>

          <link href="include/reset.css" rel="stylesheet" type="text/css" />

          <link href="include/style.css" rel="stylesheet" type="text/css" />

         

          <link rel="stylesheet" href="include/coin-slider-styles.css" type="text/css" />

          <script type="text/javascript" src="include/jquery-1.7.2.min.js"></script>

          <script type="text/javascript" src="include/coin-slider.min.js"></script>

         

          <script type="text/javascript" src="include/bw-menu.js"></script>

      <![end if]>-->

       

       

      <!--[if lte IE6]>

                <link href="include/reset.css" rel="stylesheet" type="text/css" />

          <link href="include/style.css" rel="stylesheet" type="text/css" />

         

          <link rel="stylesheet" href="include/coin-slider-styles.css" type="text/css" />

          <script type="text/javascript" src="include/jquery-1.7.2.min.js"></script>

          <script type="text/javascript" src="include/coin-slider.min.js"></script>

         

          <script type="text/javascript" src="include/bw-menu.js"></script>

         

                <link href="include/ie6PNGFix.css" rel="stylesheet" type="text/css" />

      <![end if]>-->

       

       

      </head>

      ////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////

       

      23-04-2012 14-32-40.jpg

       

      Where did I gone wrong? Thanks for the help

        • 1. Re: Conditional Statements in IE6 error?
          osgood_ CommunityMVP

          All the IE comments around your alternative css/js links are a bit mangled...try the below:

           

          <!--[if !IE 6]>

              <link href="include/reset.css" rel="stylesheet" type="text/css" />

              <link href="include/style.css" rel="stylesheet" type="text/css" />

             

              <link rel="stylesheet" href="include/coin-slider-styles.css" type="text/css" />

              <script type="text/javascript" src="include/jquery-1.7.2.min.js"></script>

           

              <script type="text/javascript" src="include/coin-slider.min.js"></script>

             

              <script type="text/javascript" src="include/bw-menu.js"></script>

          <![endif]-->

           

          <!--[if gte IE 7]>

              <link href="include/reset.css" rel="stylesheet" type="text/css" />

              <link href="include/style.css" rel="stylesheet" type="text/css" />

             

              <link rel="stylesheet" href="include/coin-slider-styles.css" type="text/css" />

              <script type="text/javascript" src="include/jquery-1.7.2.min.js"></script>

              <script type="text/javascript" src="include/coin-slider.min.js"></script>

             

              <script type="text/javascript" src="include/bw-menu.js"></script>

          <![endif]-->

           

           

          <!--[if lte IE 6]>

              <link href="include/reset.css" rel="stylesheet" type="text/css" />

              <link href="include/style.css" rel="stylesheet" type="text/css" />

             

              <link rel="stylesheet" href="include/coin-slider-styles.css" type="text/css" />

              <script type="text/javascript" src="include/jquery-1.7.2.min.js"></script>

              <script type="text/javascript" src="include/coin-slider.min.js"></script>

             

              <script type="text/javascript" src="include/bw-menu.js"></script>

             

              <link href="include/ie6PNGFix.css" rel="stylesheet" type="text/css" />

          <![endif]-->

          • 2. Re: Conditional Statements in IE6 error?
            vincentccw Community Member

            Thanks osgood_, I finally got it working using ur code, i think is mainly the because of the spacing error with "endif, IE6 and IE7",

             

            I also realize u miss out the closing and open comments for the first one, coz the render fail in non-ie browser, so i modify a bit and is all working now...=)

             

            <!--[if !IE 6]>-->

             

            <!--<![endif]-->