In existing SO literature, I have seen examples of using jquery and PHP for proxy data:
JQuery
function loadTheUrl(x){
$.ajax({ url: 'loader.php',
data: {url: x},
type: 'get',
success: function(output) {
$('.loading-space').html(output);
}
});
}
Php
<?php
$doc = new DOMDocument();
$doc->loadHTML(file_get_contents($_GET['https://www.google.com/finance/getprices?q=.NSEI&x=NSE&i=600&p=1d&f=d,o']));
echo $doc->saveHTML();
Here's what the first few lines of data look like at the URL given in PHP above. This is just plain text text, for example:
MARKET_OPEN_MINUTE=570
MARKET_CLOSE_MINUTE=960
INTERVAL=300
COLUMNS=DATE,OPEN
DATA=
TIMEZONE_OFFSET=-240
a1521120900,555.45
1,554.53
2,554.07
3,553.9
4,552.67
...
As far as I know, PHP is correct. For my use case, I need to replicate the above jquery using d3. I was hoping d3 would have something to use to interact with the data that my php file is spitting out.
, , , (.. d3.text(), d3.csv() et all) , d3.text('https://www.google.com/finance...') - . , , Google php , . , (, , ).
d3.text() php , . , : d3.text('my_loader.php'). NaN, , - . , . , . . IDE. d3- , , . , PHP. , d3 PHP-, URL, PHP. , data, d3.text() , PHP.
: , d3 PHP, ? , d3 / - , (PHP ).