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>
Source: stackoverflow.com
Related Query
- Skip inclusion of d3.js for Internet Explorer
- nvd3.js rendering solution for Internet Explorer
- internet explorer 10 not showing svg path (d3.js graph)
- In d3.js, skip append() for null data
- Internet Explorer 11 D3 javascript error - SCRIPT5 Access is denied
- Is there a way to make Internet Explorer understand this.style.setProperty?
- D3.js zoom with nested svg breaks viewport in Internet Explorer
- Broken d3.js animation in Internet Explorer
- CSS transform rotate not working in internet explorer 11
- Why doesn't Internet Explorer show foreignObject?
- How to make nvd3 work in Internet Explorer 8?
- Anomalous mouseover handling with D3.js in Internet Explorer 11
- D3.js chart is visible in Internet Explorer 11 but invisible in Internet Explorer 11
- Fetching csv data on Internet Explorer failed
- Internet Explorer Scaling not working properly
- object HTMLImageElement cannot be "saved as" image in Internet Explorer
- SVG Container issue in internet explorer
- cubism.js and Internet Explorer
- Collapsible tree diagram v4 and Internet Explorer
- D3 SVG issue in Internet Explorer
- What is the problem with D3js working with Internet explorer 11
- Zoom to Box examples on https://bl.ocks.org do not work properly with Internet Explorer
- d3.js Map not rendering on Internet Explorer or Firefox, Only Chrome
- d3 graph in iframe in internet explorer 9 not working
- D3.js: How to get the computed width and height for an arbitrary element?
- A good book for learning D3.js
- What is the d3.js v4.0 equivalent for d3.scale.category10()?
- Appending multiple non-nested elements for each data member with D3.js
- How to set text color for my d3 chart title?
- How to disable double click zoom for d3.behavior.zoom?
More Query from same tag
- Javascript or other charting library for geodata
- forceManyBody filtered in d3
- DC JS: remove outer padding for line charts with an ordinal scale x-axis?
- unable to extract and separately colour subunits in d3
- D3 taking an array of two objects and reading it into a D3 shape
- React D3 component did not get unmounted upon (component) redirect using history.push()
- reload d3 graph when a 'dropdown menu value changes
- D3.js Dynamic connector between objects
- Equivalent of jQuery's 'not' selector in D3.js?
- Gauge charts with sub value indicators and label
- d3 selectAll and accesing item with index gives different result
- D3.js Force Directed Graph with Json - Create graph specifying link distance from all nodes
- D3 exit transition: animation translate to left before remove
- An example of world map using dimple.js
- D3 Linear Scaling - Color code mismatch
- GitHub -> JSFiddle directory structure error
- Opacity update on all d3.svg.circles except for the class hovered
- file loads differently from browser to browser
- How to add transition to the creation and deletion of a context menu in d3.js?
- Add a line on the y axis d3
- d3 draggable threshold, d.x is undefined
- D3: Render Flare Graph Titles avoiding text overlap
- d3.js - Error on zoom (iOS)
- using d3 data properties to set inner HTML to an img link
- How to make 2 color represent positive and negative word cloud in d3.js from csv
- Why 'scaleLinear' never used? and Why I have to included as a <script d3.v4.js>?
- C3 timeseries chart giving error Invalid value for <path> attribute
- How to use D3 inside a ui-view state
- d3 js renders plot in html generated by local server but not by GAE
- D3 scatter plot - visible points outside the chart after zoom