1
d3.xhr을 사용하여 데이터를 업데이트하는 예를 찾고 있었지만 명확한 내용이나 적어도 저의 이해 수준은 보지 못했습니다. 다음이 링크를 가까이하지만 시가 있습니다 from stackoverflow d3.xhr 예 또는 AJAX d3의 방법
- 나는 주위를 더보고 JQuery와 및 PHP에서이 예제를 발견했다. 나는 그것을 시도하고 코드를 이해한다. d3.xhr 또는 d3.json에서 동일한 코드를 제공하면 감사하겠습니다. BTW, d3.xhr과 d3.json의 차이점은 무엇이며 언제 사용합니까? 미리 감사드립니다.
<?php // AJAX & PHP example // http://iviewsource.com/codingtutorials/learning-how-to-use-jquery-ajax-with-php-video-tutorial/ if ($_GET['ip']) { $ip = gethostbyname($_GET['ip']); echo($ip); exit; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Get Reverse IP</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"> </script> </head> <body> Please enter a domain name <input type="text" id="searchip"> <div id="resultip"></div> <script> $(document).ready(function() { $('#searchip').change(function(){ $.ajax({ type: "GET", url: "ajax.php", data: 'ip=' + $('#searchip').val(), success: function(msg){ $('#resultip').html(msg); } }); // Ajax Call }); //event handler }); //document.ready </script> </body> </html>
d3 xhr/json 문서를 읽었습니까? https://github.com/mbostock/d3/wiki/Requests –
나는 그것을했다, 나는 아직도 그것을 얻지 않는다. 좀 더 힌트를 줄 수 있어요? – ngungo