/*
* ie-note.js -- alerts users of IE about lack of standards-compliance
*
* to use, source this script from the HTML file:
*
*
*
* Note that you need an event handler, such as
* http://dean.edwards.name/weblog/2005/10/add-event/
* or insure otherwise that insertNote() is called *after* the whole page has
* been rendered and the DOM initialised.
*
* The notice can be styled with CSS, using the ie-note class name.
*
* SVN url: http://svn.madduck.net/pub/web/martin-krafft.net/js/ie-note.js
*
* Copyright © martin f. krafft
* Released under the terms of the Artistic Licence 2.0
*
* Revision: $Id: dchangesfilename 295 2006-10-07 11:20:26Z madduck $
*/
function isIE()
{
return navigator.appName.indexOf('Internet Explorer') > 0 ||
navigator.appName.indexOf('MSIE') > 0;
}
function insertNote()
{
var query = unescape(location.search);
if (isIE() || query.indexOf('ie-note') > 0) {
var container = document.createElement("p");
container.className = 'ie-note';
container.innerHTML =
'Notice: you are using Microsoft\'s Internet Explorer, '
+ 'which does not properly support the XHTML and CSS standards used in writing '
+ 'this page the way it is supposed to look. The information is still '
+ 'all there, but for a better result, please consider alternative '
+ 'browsers, such as '
+ 'Mozilla Firefox.';
var body = document.getElementsByTagName("body")[0];
body.insertBefore(container, body.firstChild);
}
}
// see http://dean.edwards.name/weblog/2005/10/add-event/
addEvent(window, 'DOMContentLoaded', insertNote);