Navigation

12/05/2011

IE warning message

Using Javascript to show warning only in Internet Explorer Browser:



<script language="javascript">
function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
  var rv = -1; // Return value assumes failure.
  if (navigator.appName == 'Microsoft Internet Explorer')
  {
    var ua = navigator.userAgent;
    var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
      rv = parseFloat( RegExp.$1 );
  }
  return rv;
}
function checkVersion()
{
  var msg = "<p>Internet Explorer Users:<br> You will get a popup warning message (view content that was delivered securely).  You can <a href='http://blogs.msdn.com/b/askie/archive/2009/05/14/mixed-content-and-internet-explorer-8-0.aspx' target='_blank'>change IE settings</a> to avoid this warning, or use Firefox or Chrome instead.</p><p>&nbsp;</p>";
  var ver = getInternetExplorerVersion();

  if ( ver > -1 )
  {
    if ( ver >= 8.0 )
     
  document.write( msg );
  }

}

checkVersion();       


function getInternetExplorerVersion()
// Returns the version of Internet Explorer or a -1
// (indicating the use of another browser).
{
var rv = -1; // Return value assumes failure.
if (navigator.appName == 'Microsoft Internet Explorer')
{
var ua = navigator.userAgent;
var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
if (re.exec(ua) != null)
rv = parseFloat( RegExp.$1 );
}
return rv;
}
function checkVersion()
{
var msg = "
Internet Explorer Users: You will get a popup warning message (view content that was delivered securely).  You can change IE settings to avoid this warning, or use Firefox or Chrome instead.

";
var ver = getInternetExplorerVersion();

if ( ver > -1 )
{
if ( ver >= 8.0 )

document.write( msg );
}

}

checkVersion();       

</script>