Uncaught TypeError:Object [object Array]没有方法“nodes” [英] Uncaught TypeError: Object [object Array] has no method 'nodes'

查看:205
本文介绍了Uncaught TypeError:Object [object Array]没有方法“nodes”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想让这个范例正常运作;

I am trying to get this example working;

http://bl.ocks.org/mbostock/raw/2966094/46279db71d3c218664f72e1d3cb74cb2fb46da43/

这个例子在网上很完美。但是当我复制示例到我的本地MAMP安装,我得到以下错误:

The example online works perfectly. But when I copy the example to my local MAMP installation, I get the following error:

Uncaught TypeError: Object [object Array] has no method 'nodes'.

我的json正确加载,有人知道这个问题来自哪里?

My json is loading correctly, does anyone know where this problem is coming from?

推荐答案

我只是做了以下事情:

git clone https://gist.github.com/2966094.git pedigree_tree
cd pedigree_tree
python -m SimpleHTTPServer

...然后打开浏览器:

... and then opened my browser to:

http://localhost:8000/

该示例工作没有任何问题,这是预期的。

The example works without any problems, which is to be expected.

也许你可以尝试复制我的步骤(你应该在你的Mac上有Python)。如果它通过python SimpleHTTPServer工作,那么假设你的MAMP配置会出错。

Perhaps you could try replicating my steps (you should have Python on your Mac). If it works via the python SimpleHTTPServer, the assumption would be that something is awry with your MAMP configuration.

或者,你的下载/克隆示例出错了。您是否在浏览器开发人员控制台(Chrome:选单|工具|开发人员工具)中看到任何错误?

Alternatively, perhaps something went wrong with your download / clone of the example. Do you see any errors in your browser developer console (in Chrome: Menu | Tools | Developer Tools)?

这篇关于Uncaught TypeError:Object [object Array]没有方法“nodes”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆