Web Analytics Made Easy -
StatCounter Cannot execute a css script through IE9,works fine with Mozilla - CodingForum

Announcement

Collapse
No announcement yet.

Cannot execute a css script through IE9,works fine with Mozilla

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cannot execute a css script through IE9,works fine with Mozilla

    I need to get the below mentioned code working in IE9,it works absolutely fine with Firefox.
    I have included the DOCTYPE,meta for ie9,set the browser mode to IE9 Compatibility view and Document mode to IE9,but it still doesn't work.

    Any help would be appreciated.

    CSS code:clmenu.css

    .mC {width:100px; margin:5px; float:right;}
    .mH {color:#60c; cursorointer; font-weight:bold; border-top:1px solid #300;}
    .mL {display:none; margin-bottom:10px;}
    .mO {margin-left:10px; display:block;}

    Javascript: clmenu.js

    function toggleMenu(objID) {
    if (!document.getElementById) return;
    var ob = document.getElementById(objID).style;
    ob.display = (ob.display == 'block')?'none': 'block';
    }


    HTML: clmenu.html

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 1.0 Strict//EN"
    "http://www.w3.org/TR/html1/DTD/html1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">

    <html>
    <head>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <meta http-equiv="content-language" content="en-us" />
    <script src="clmenu.js" type="text/javascript"></script>
    <link href="clmenu.css" type="text/css" rel="stylesheet" />
    </head>
    <body>
    <div class="mC">
    <div class="mH"
    onclick="toggleMenu('menu1')">+ Collapsible</div>
    <div id="menu1" class="mL">
    <a class="mO" href="blclmenu1.htm">Head Script</a>
    <a class="mO" href="blclmenu2.htm">Stylesheet</a>
    <a class="mO" href="blclmenu3.htm">Add Menus</a>
    </div>
    <div class="mH"
    onclick="toggleMenu('menu2')">+ Dropdown</div>
    <div id="menu2" class="mL">
    <a class="mO" href="blmenu.htm">Introduction</a>
    <a class="mO" href="blmenu1.htm">Head Script</a>
    <a class="mO" href="blmenu2.htm">Customize</a>
    <a class="mO" href="blmenu3.htm">Body Script</a>
    </div>
    </div>

    <body>
    </html>

  • #2
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD [COLOR="Red"]HTML 1.0[/COLOR] Strict//EN"
     "http://www.w3.org/TR/[COLOR="Red"]html1[/COLOR]/DTD/[COLOR="Red"]html1-strict[/COLOR].dtd">
    There is no such a Doctype. I suspect you wanted to use an XHTML DTD, thus:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD [COLOR="Blue"]X[/COLOR]HTML 1.0 Strict//EN"
     "http://www.w3.org/TR/[COLOR="Blue"]x[/COLOR]html1/DTD/[COLOR="Blue"]x[/COLOR]html1-strict.dtd">
    Or you may simply use an HTML5 DTD, which will render properly an XHTML strict code, if it is well formatted.
    Code:
    <!DOCTYPE HTML>
    Last edited by Kor; Sep 8, 2011, 07:22 AM.
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

    Comment

    Working...
    X
    😀
    🥰
    🤢
    😎
    😡
    👍
    👎