I get reports that a button does not work in my webapp on IE8 (and older). Everything works in IE9, FF and Chrome. The error is triggered in this click-bind:
$("#save_refresh").click(function(e) {
alert('hello world!');
});
This is the html:
<input class='button' type='button' value='Save / Refresh' id='save_refresh' />
When clicking the button in IETester running IE8, the “hello world!” is not shown and I get this error:
Line: 17
Character: 28691
Error:
Code: 0
URL: jquery-1.6.1.min.js
So my question is:
is there anything wrong with my above code OR does anyone know how to debug javascript in older version of IE.
I agree with Quentin. You should download one of Microsoft’s Internet Explorer Application Compatibility VPC Images to properly test your code. Paul Irish has a good article on the incompatibilities of Internet Explorer compatibility modes.
The IE9 compatibility modes are unreliable in terms of giving you an accurate picture of how the browser will actually render your page and how your page will behave under that browser. It’s like putting a Chevrolet Metro engine in your Chevrolet Aveo so you can test drive the Metro.
That said, when using IE8, you can just hit F12 like in IE9, but with IE7, you need to have a copy of Visual Studio and use the
debuggerkeyword.