3
votes

can any one help me out for below error in IE 8 Error Details is below:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; CMDTDF; BRI/1) Timestamp: Tue, 9 Apr 2013 12:25:37 UTC

Message: Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus. Line: 1013 Char: 5 Code: 0 URI: /views/js/online.js

1
Can you post the content of line 1013 in online.js?Eydun

1 Answers

2
votes

This is a legitimate error.

It is surprisingly difficult to tell if an element is visible on an HTML page. You basically have to traverse up the DOM tree checking to see if the element or any parent element has a css property of 'display:none'.

You could just wrap the calling code with a

try { 
  element.focus(); 
} 
catch (ex) { }

Or if you are using something like jQuery

if ($element.is(':visible')) {
   $element.focus();
}