score:0

$('form').find(':submit').on('click', function() {
    var t = $('form').serialize();
    var u = 'http://localhost:8888/saff/indexi.php?' + t;
    $.ajax({
        url: u,
        async: true,
        success: function(data) {
            funn(data);
        }
    });

    function funn(treeData) {
        d3.json(u, function(error, treeData) {
            //d3 code
        });
    }
    return false;
});

Related Query