score:1

Accepted answer

you can check the browser useragent to check if it is ie, if not then load the d3 script.

you can refer to the code below, it works well and clear d3 console error in ie 11:

<!doctype html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
    <script>
        var ua = window.navigator.useragent;
        var msie = ua.indexof("msie ");
        if (!(msie > 0 || !!navigator.useragent.match(/trident.*rv\:11\./))) //if not ie, load d3 script
        {
            document.write('<script src="scripts/d3.js"><\/script>');
        } 
    </script>
</head>
<body>
    <svg>
        <circle class="target" style="fill: #69b3a2" stroke="black" cx=50 cy=50 r=40></circle>
    </svg>
    <script>
        if (window.d3) {
            d3.select(".target").style("stroke-width", 8);
        }
        else {
            alert("ie");
        }
    </script>
</body>
</html>

Related Query

More Query from same tag