malsup / blockui

jQuery BlockUI Plugin
http://jquery.malsup.com/block/
1.69k stars 506 forks source link

IE 8.0 WinVista raises javascript error "Not Implemented" because it's treated as IE6 #56

Closed WanderingZombie closed 11 years ago

WanderingZombie commented 11 years ago
[HTTP_USER_AGENT] => Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB7.4; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.30729; .NET4.0C; .NET CLR 3.0.30729; OfficeLiveConnector.1.5; OfficeLivePatch.1.3; BRI/2)

So I think BlockUI is believing the browser to be IE6 when it's really IE8 due to the following test:

var ie6  = /MSIE 6.0/.test(navigator.userAgent);

The user agent above clearly has 'MSIE 8.0' and 'MSIE 6.0' within in.

As variable ie6 is true, this then triggers the following test when it shouldn't as setExpression is not defined...

if (ie6 || expr) { ...

... and so causing the Not Implemented error on a later statement.

Perhaps code needs to be added so that ie6 can only be true if similar tests for MSIE 7 and MSIE 8 were also performed and had to be false?

var ie6  = /MSIE 6.0/.test(navigator.userAgent);
var ie7  = /MSIE 7.0/.test(navigator.userAgent);
var ie8  = /MSIE 8.0/.test(navigator.userAgent);
ie6 = ie6 && !ie7 && !ie8;

There may well be a better more elegant way, but you get the idea?

malsup commented 11 years ago

Thanks. I forgot about that vista scenario when I removed the $.browser code.