d3-plugins
d3-plugins copied to clipboard
Make JSONP work with services which don't support a dot in the callback name
Some services don't handle names like d3.jsonp.badger. This lets us support those services.
The advantage of the other way was that you don't pollute the global namespace at all, and there's no chance of overwriting functions. If we're going to switch approaches, this should at least use a predictable prefix to ensure that it doesn't generate an already-used name and overwrite it.
We could also check to see if the name already exists in the namespace and generate another one.
On 26 July 2013 00:13, Tom MacWright [email protected] wrote:
The advantage of the other way was that you don't pollute the global namespace at all, and there's no chance of overwriting functions. If we're going to switch approaches, this should at least use a predictable prefix to ensure that it doesn't generate an already-used name and overwrite it.
— Reply to this email directly or view it on GitHubhttps://github.com/d3/d3-plugins/pull/71#issuecomment-21556468 .
Yep, that would work - this is admittedly an unlikely failure but would fail pretty hard when it does.