Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/431.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在IE11中,`.attr`()更新`<;路径>`_Javascript_D3.js_Svg_Internet Explorer 11 - Fatal编程技术网

Javascript 在IE11中,`.attr`()更新`<;路径>`

Javascript 在IE11中,`.attr`()更新`<;路径>`,javascript,d3.js,svg,internet-explorer-11,Javascript,D3.js,Svg,Internet Explorer 11,使用d3的方法.attr更新在IE11中没有效果?如果我删除style=“marker end:url(#end arrow)”,它将在IE11中变得正常。如何获得类似Chrome显示器的效果 错误: HTML: JavaScript: d3.select('input[name=update1]').on('click', function() { d3.select('path.link').attr('d', 'M100,100L300,100'); d3.select('circ

使用d3的方法
.attr
更新
在IE11中没有效果?如果我删除
style=“marker end:url(#end arrow)”
,它将在IE11中变得正常。如何获得类似Chrome显示器的效果

错误

HTML:

JavaScript:

d3.select('input[name=update1]').on('click', function() {
  d3.select('path.link').attr('d', 'M100,100L300,100');
  d3.select('circle.end')
    .attr('cx', '300')
    .attr('cy', '100')
})
d3.select('input[name=update2]').on('click', function() {
  d3.select('path.link').attr('d', 'M100,100L200,200');
  d3.select('circle.end')
    .attr('cx', '200')
    .attr('cy', '200')
})

你能帮我改变我写的例子吗

你的JSFIDLE在IE11中对我有效。也就是说,据我所知,它在我签入的所有浏览器(Firefox、Chrome、IE11和Edge)中的工作原理完全相同。@Phylogence当你点击按钮(update1和update2)时,该行的位置在IE11中不会改变。@Phylogence我刚刚改进了问题的内容,你能帮我看看吗?谢谢。你的第二个例子在IE11中也适用于我。您确定d3库为您正确加载了吗?这不是我第一次看到第三方JS库和中国长城防火墙出现问题。这个问题与中描述的问题密切相关。虽然IE 10会移动线条,但不会移动标记,但如果上面有标记,IE 11根本不会移动线条,这就是你所看到的。但是,将修复两个版本IE的问题。
path.link {
  fill: none;
  stroke: #333;
  stroke-width: 2px;
  cursor: default;
}
circle {
   stroke: black;
   stroke-width: 1;
   fill: #f3f5f6;
}
d3.select('input[name=update1]').on('click', function() {
  d3.select('path.link').attr('d', 'M100,100L300,100');
  d3.select('circle.end')
    .attr('cx', '300')
    .attr('cy', '100')
})
d3.select('input[name=update2]').on('click', function() {
  d3.select('path.link').attr('d', 'M100,100L200,200');
  d3.select('circle.end')
    .attr('cx', '200')
    .attr('cy', '200')
})