我试图在我的页面中使用getOrgChart库,但我的浏览器一直坚持它不是一个函数:
代码如下:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script src="getorgchart.js"></script>
<link rel="stylesheet" src="getorgchart.css">
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.0/themes/base/jquery-ui.css">
<script>
$("#orgStaffing").getOrgChart({
theme: 'vivian',
primaryColumns: ['name','division','project','email'],
imageColumn: 'image',
gridView: true,发布于 2016-09-14 01:03:29
在第二封电子邮件'jdoe@company.com‘前添加引号
我试着复制你的问题
$("#orgStaffing").getOrgChart(
{
theme: 'vivian',
primaryColumns: ['name','division','project','email'],
imageColumn: 'image',
gridView: true,
dataSource: [
{id: 1, parentId: null, name: 'John Smith', division: 'Inbound', project: 'West', email: 'jsmith@company.com', image: 'johnsmith.jpg'},
{id: 2, parentId: 1, name: 'Jane Doe', division: 'Inbound', project: 'West', email: 'jdoe@company.com', image: 'janedoe.jpg'}
]
});html, body {margin: 0px; padding: 0px;height: 100%; overflow: hidden; }
#people {width: 100%;height: 100%; } <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script type="text/javascript" src="http://www.getorgchart.com/GetOrgChart/getorgchart/getorgchart.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.getorgchart.com/GetOrgChart/getorgchart/getorgchart.css">
<div id="orgStaffing"></div>
它起作用了
请确保dataSource是有效的JSON对象。
https://stackoverflow.com/questions/39459503
复制相似问题