d3-plugins icon indicating copy to clipboard operation
d3-plugins copied to clipboard

Make JSONP work with services which don't support a dot in the callback name

Open danni opened this issue 12 years ago • 3 comments

Some services don't handle names like d3.jsonp.badger. This lets us support those services.

danni avatar Jul 25 '13 11:07 danni

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.

tmcw avatar Jul 25 '13 14:07 tmcw

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 .

danni avatar Jul 25 '13 23:07 danni

Yep, that would work - this is admittedly an unlikely failure but would fail pretty hard when it does.

tmcw avatar Jul 29 '13 14:07 tmcw