I am looking for something similar to CSS’s <!--[if IE]> decaration for JavaScript. I don’t have time to find out why a line of code is not working in IE, and commenting it out doesn’t break the page, so I am thinking “stuff IE” and looking for a way to comment the line out only for IE.
Any ideas?
navigator.appName will contain the browsers name, in your case you are looking for ‘Microsoft Internet Explorer’ so that would be your condition in this case:
I would search for better browser detection than this since this is as simple and small as it gets.