Fixing CSS and JavaScript Bugs in Internet Explorer
This article gives the detailed information on how you can fix CSS and JavaScript bugs in Internet Explorer by following the specific instructions.

As many users around the globe are still using Internet Explorer (IE), as a developer we need to deal with the bugs of IE. Certainly IE 6 has been the nightmare of many designers, IE 7 looks better but still had some problems, IE 8 was better still, and IE 9 is certainly much better, but to the extent that you care about supporting older versions of IE. You may face design problems that you need to solve so this article is intended to give some advice. We typically use IE conditional comments to fix the IE issues.
Fixing CSS Bugs
- While creating a design or template for a website you should design the same in Firefox or in Chrome. Once the design is completed look for the problems in different versions of IE because IE is the least standards compliant browser. The issues can be fixed by using IE Specific CSS files that do not affect other browsers.
-
The IE conditional comments can be used in the head section of html page to fix the issues in IE.
This example only affects IE 6
<!--[if lt IE 7]>
<link rel="stylesheet" href="style-ie6.css" type="text/css"/>
<![endif]-->This example only affects IE 7
&><!--[if IE 7]>
<link rel="stylesheet" href="/style-ie7.css" type="text/css" />
<![endif]-->
This example affects any version of IE
&><!--[if IE]>
css codes can be written here
.container{float:left;width:100%;}
<![endif]-->
Fixing JavaScript Bugs
Normally IE gives the following JavaScript error when a HTML page loads.

The following error appears in the page because of following reasons
-
If the <script> block is not written properly.
For Ex.
<script type="application/javascript">
//Wrong. This will give error.
Solution:<script type="text/javascript">
// Correct -
When a JavaScript function is called in onload function but the function is not written in any part of the page.
For Ex.
<body onload="init();"
If the init function is not written in any part of the page then it will give an error.
Solution: Remove the JavaScript event and the function.