在 d3.js 中单击具有 URL 的节点时无法打开弹出窗口

Unable to open popup when clicking on a node with URL in d3.js

在我的一个项目中,我使用 D3.js 来制作树。当用户单击具有 URL 的节点时,一些子节点链接到各种 places.I 试图打开弹出窗口 window。我正在尝试的代码部分是:

e.append("svg:a").attr("target", "E2B").attr("xlink:href", function(a) {
  return a.url;
}).append("text").attr("x", function(a) {
  return a.children || a._children ? -10 : 10;
}).attr("dy", ".35em").attr("text-anchor", function(a) {
  return a.children || a._children ? "end" : "start";
}).text(function(a) {
  return a.name;
}).style("fill-opacity", 1E-6)
  .on("click",window.open(d.url,'','width=600,height=300'));

使用上面的代码,当我在浏览器中加载项目时,我在加载时收到一个新的空白弹出窗口 window。此外,当我单击其中一个包含 URL 的子节点时,会打开相同的空白弹出窗口 window。有人可以告诉我我的代码有什么问题吗?

如果您需要,这是我的全部 HTML 代码 - http://pastebin.com/tLZfmEg9

这是我自己解决的工作代码。用这个替换问题中给出的代码。

e.append("svg:a").attr("target", "E2B").on("click", function(a){
if( a.url == null){} else {
  window.open(a.url,'',"width=800,height=600")}
}).append("text").attr("x", function(a) {
  return a.children || a._children ? -10 : 10;
}).attr("dy", ".35em").attr("text-anchor", function(a) {
  return a.children || a._children ? "end" : "start";
}).text(function(a) {
  return a.name;
}).style("fill-opacity", 1E-6);