Javascript 当包含jQuery mobile CSS my<;表格>&书信电报;标签>;来自D3的操作不起作用
这是我的HTML:Javascript 当包含jQuery mobile CSS my<;表格>&书信电报;标签>;来自D3的操作不起作用,javascript,jquery,html,css,d3.js,Javascript,Jquery,Html,Css,D3.js,这是我的HTML: <head> <script type="text/javascript" src="//chalk1up.net/climb/3rdparty/d3.v3.min.js"></script> <script type="text/javascript" src="graph_functions.js"></script> <? include 'head1.html'; ?>
<head>
<script type="text/javascript" src="//chalk1up.net/climb/3rdparty/d3.v3.min.js"></script>
<script type="text/javascript" src="graph_functions.js"></script>
<? include 'head1.html'; ?>
<? include 'head2.html'; ?>
</head>
<body>
<script type="text/javascript" src="//d3.v3.min.js"></script>
<div data-role="page" id="home" data-theme="a">
<? include 'navbar.php'; ?>
<div data-role="content">
<div id="graph_avg" data-role="fieldcontain">
<label><input type="radio" name="dataset" value="bouldering" checked> Bouldering</label>
<label><input type="radio" name="dataset" value="ropes"> Ropes</label>
</div>
<? include 'footer.html'; ?>
</div>
</body>
<!--<script type="text/javascript" src="pie.js"></script> -->
<script type="text/javascript" src="pie.js"></script>
出于某种原因,当我从HTML中删除这一行时:
<? include 'head1.html'; ?>
@nrabinowitz这是我从console.log(path_pie)获得的结果:
[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT],[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]、[对象SVGPATHELENT]
var selection = d3.selectAll("input").on("change", change);
console.log("Selection:" + selection);
选择:[对象HTMLInputElement],[对象HTMLInputElement]
已解决:
替换此行:
d3.selectAll("input").on("change",change);
为此:
$('input').on("change", change);
如果只显示相关的代码,您将有更好的机会得到一个好的答案。讨论中的主要代码是移动CSS库和
head1.html
的内容,两者都不包括在这里。可能change
中的this
不是您所期望的,因此dataset[this.value]
不会给你你想要的。console.log()在这里说什么?@nrabinowitz我现在只输入了相关的代码,我添加了head1.html代码行,这就是问题所在。我不相信这个变化是问题所在,因为它在实际调用“change”时起作用,但问题更多地在于按钮()不让操作调用“更改”
var selection = d3.selectAll("input").on("change", change);
console.log("Selection:" + selection);
d3.selectAll("input").on("change",change);
$('input').on("change", change);