I have been looking for a method. As Javascript is not working.

After applying your method still its being detected as IE7.

http://detectmybrowser.com/

Suppressing error is not just solution. As we do need the script to work as well.