A question about Loader baseURL

Kevin Smith khs4473 at gmail.com
Mon Aug 27 07:38:12 PDT 2012

(This pretty much just repeats what hax said...)

> `load` is a method, which can be called anywhere.  Having it depend on
> a dynamically-scoped bit of information such as the url of the file
> that the method is called in, would make using loaders much harder to
> understand.

Perhaps, but I fear this will limit the usefulness of dynamic loading to
absolute URLs.  If a programmer writes:

    System.load("my-file.js", Module => { ... });

It's highly unlikely that they care about the URL of the page or the
baseURL of the current loader or any other "remote knowledge" like that.
 It's just not modular : )

This is just like current browser behavior when you insert a `<script
> src="test.js">` tag -- "test.js" is looked up relative to the URL of
> the *page*, not relative to the URL of the js file that does the dom
> manipulation.

: )  Yes, and that behavior makes loading anything other than absolute
URLs, um, "tricky".

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120827/a6a5cbd0/attachment-0001.html>

More information about the es-discuss mailing list