| Total Complexity | 6 |
| Complexity/F | 3 |
| Lines of Code | 24 |
| Function Count | 2 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | /** |
||
| 8 | ( function() { |
||
| 9 | var isIe = /(trident|msie)/i.test( navigator.userAgent ); |
||
|
|
|||
| 10 | |||
| 11 | if ( isIe && document.getElementById && window.addEventListener ) { |
||
| 12 | window.addEventListener( 'hashchange', function() { |
||
| 13 | var id = location.hash.substring( 1 ), |
||
| 14 | element; |
||
| 15 | |||
| 16 | if ( ! ( /^[A-z0-9_-]+$/.test( id ) ) ) { |
||
| 17 | return; |
||
| 18 | } |
||
| 19 | |||
| 20 | element = document.getElementById( id ); |
||
| 21 | |||
| 22 | if ( element ) { |
||
| 23 | if ( ! ( /^(?:a|select|input|button|textarea)$/i.test( element.tagName ) ) ) { |
||
| 24 | element.tabIndex = -1; |
||
| 25 | } |
||
| 26 | |||
| 27 | element.focus(); |
||
| 28 | } |
||
| 29 | }, false ); |
||
| 30 | } |
||
| 31 | } )(); |
||
| 32 |
This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.
To learn more about declaring variables in Javascript, see the MDN.