Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Node support via xmlhttprequest. #8

Closed
mbostock opened this issue Feb 14, 2016 · 1 comment
Closed

Add Node support via xmlhttprequest. #8

mbostock opened this issue Feb 14, 2016 · 1 comment
Assignees

Comments

@mbostock
Copy link
Member

Related d3/d3#2736, we could use xmlhttprequest to add support for Node. Though, I’m not sure yet exactly how we express that dependency for Rollup so that it doesn’t affect non-CommonJS environments and Browserify.

@mbostock
Copy link
Member Author

This seemed to work:

var Xhr = typeof XMLHttpRequest === "function"
    ? XMLHttpRequest
    : require("xmlhttprequest").XMLHttpRequest;

Though, d3.html doesn’t work, since it would also require a jsdom dependency and a global document.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant