如何在不重新加载页面的情况下动态更改json?

时间:2017-05-27 21:15:03

标签: javascript jquery json ajax

我的js代码中有这个结构

    treeJSON = d3.json("/data", function (error, treeData) {
            // All code are here
            // making tree graph from json
            // and this is button 
            var button = '<button type="button" class="btn btn-success">Move next</button>&nbsp;';
            $(function () {
              $('button').click(function () {
                //change json for whole project without reloading
              });
            });

我认为我必须使用AJAX,但我找不到方法......

您可以从服务器上的“/ data”网址获取所有新的json

我无法显示所有400行代码,但我可以说它与this

类似

0 个答案:

没有答案
相关问题