2
good there is some way to send D3 parameters to make a request to php.
I have a search form that will send data to php in post form I wanted and return the result in json
d3.json("../querys/querys.php", function(error, graph) {
2
good there is some way to send D3 parameters to make a request to php.
I have a search form that will send data to php in post form I wanted and return the result in json
d3.json("../querys/querys.php", function(error, graph) {
1
To D3 documentation refers only two arguments passed to the function:
d3.json(url[, callback])
That means you have to send the data on query string concatenated with the url, and the server has to interpret this.
var data = '?nome=joao&idade=45';
d3.json("../querys/querys.php" + data, function(error, graph) {
Browser other questions tagged d3.js
You are not signed in. Login or sign up in order to post.
Hello Cousin :) in this case if it has to POST, it cannot be with querystring in the URL, the data in an HTTP POST is sent in the body, not in the URL. and in this case, using D3, there is xhr.post. example:
d3.xhr('../querys/querys.php').post(JSON.stringify({a: 2, b: 3}), function(error, data) {
 // callback
 });
– andre.barata
@Andre.barata good to see you here :) I had not read that the request was POST... Give an answer, so the question gets better answered :)
– Sergio
and next to php I can’t read the values ..
– usersantos
@user2964140 how are you receiving these values in PHP?
– Sergio
as post . I used the example given by the cheap Andre
– usersantos
@user2964140 hadn’t read that you needed to post. I leave an example for GET, as I said in the reply: http://jsfiddle.net/Sergio_fiddle/pxdvn83p/
– Sergio
I’m trying to make a diagram of Sankey origin destination
– usersantos