Skip to content

Instantly share code, notes, and snippets.

@dipaktelangre
Last active December 17, 2015 12:38
Show Gist options
  • Select an option

  • Save dipaktelangre/5610722 to your computer and use it in GitHub Desktop.

Select an option

Save dipaktelangre/5610722 to your computer and use it in GitHub Desktop.
Check IE versions
Check IE Version
// This function returns Internet Explorer's major version number,
// or 0 for others. It works by finding the "MSIE " string and
// extracting the version number following the space, up to the decimal
// point, ignoring the minor version number
<SCRIPT LANGUAGE="JavaSCRIPT">
function msieversion()
{
var ua = window.navigator.userAgent
var msie = ua.indexOf ( "MSIE " )
if ( msie > 0 ) // If Internet Explorer, return version number
return parseInt (ua.substring (msie+5, ua.indexOf (".", msie )))
else // If another browser, return 0
return 0
}
</SCRIPT>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment