I don't know why, but this comment is no longer on github.

JSONP works by providing a uniquely machine-named callback in the URL for
each request, so the requests will always look like different URLS.

eg

http://twitter.com/tweets/?callback=json1360874190136
http://twitter.com/tweets/?callback=json1360874223139

Of course, for this particular implementation, user code would have to
manage it's own callback in the global scope, but that's trivial.




On Thu, Feb 14, 2013 at 3:23 PM, Jim Porter <notifications@github.com>wrote:

> In shared/js/lazy_loader.js:
>
> > +      document.head.appendChild(style);
> > +      callback();
> > +    },
> > +
> > +    load: function(files, callback) {
> > +      if (!Array.isArray(files))
> > +        files = [files];
> > +
> > +      var loadsRemaining = files.length, self = this;
> > +      function perFileCallback(file) {
> > +        var node = self._inDOM[file];
> > +        if (node) {
> > +          // Remove the node from the DOM (for cases like JSON-P usage)
> > +          node.parentNode.removeChild(node);
> > +          delete self._inDOM[file];
> > +        }
>
> In any case, I don't expect that this would work very well for JSON-P
> anyway, since we keep track of what we've already loaded so as not to
> reload it. I imagine that for lots of JSON-P usages, you actually want to
> re-run the script every time you load it, in order to get updates.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/mozilla-b2g/gaia/pull/8088/files#r3019526>.
>
>