Here's my entire "Test for SVG and complain if not available" function, complete with hacky innerHtml usage. Ironically the close box causes an error when clicked in IE8 because D3 assumes addEventListener() is available. I care about ][ that much.
// Display a warning for browsers without SVG
var svgWarningHtml = '\
<div id="svgWarning"\
style="z-index: 1; width: 300px; padding: 8px 8px 8px 8px;\
position: fixed; top: 200px; left: 50%; margin-left: -150px;\
background: #ffd; border: solid 4px #b00; font-size: 14pt;">\
<div id="warnclose"\
style="position: absolute; right: 12px; color: white; font-weight: bold; cursor: default;"\
>X</div>\
<div id="warntitle"\
style="font-weight: bold; background: #b00; color: white; text-align: center;"\
>WARNING</div>\
Your browser does not support SVG, a required feature for this site.\
Please see <A href="about.html#browser">about browser compatibility</a>.</div>\
</div>';
function svgWarning() {
// SVG test taken from Modernizr 2.0
if (!!document.createElementNS &&
return;
// No SVG, do something about it.
d3.select("body").append("div").html(svgWarningHtml);
d3.select("#warnclose").on("click", function() {
d3.select("#svgWarning").style("display", "none") });
}