UNPKG

d3

Version:

A small, free JavaScript library for manipulating documents based on data.

11 lines (10 loc) 309 B
d3.html = function(url, callback) { d3.text(url, "text/html", function(text) { if (text != null) { // Treat empty string as valid HTML. var range = document.createRange(); range.selectNode(document.body); text = range.createContextualFragment(text); } callback(text); }); };