Changing dependencies during the load process.

John Barton johnjbarton at google.com
Wed Aug 20 16:20:31 PDT 2014


On Wed, Aug 20, 2014 at 3:23 PM, Ian Hickson <ian at hixie.ch> wrote:

> On Wed, 20 Aug 2014, John Barton wrote:
> > > >
> > > > The reverse case, where a img depends on a script, is not a use
> > > > case.
> > >
> > > Why not? What if the image has an onmouseover handler that calls an
> > > API function defined in a module, for instance?
> >
> > Then the page depends on the onmouseover handler code and it has a
> > dependency on the module. Images are leaf nodes in the dependency tree.
>
> Can you show me the markup for how you would like this to work? I'm not
> sure I follow what your vision is here.
>

<script>
System.import('jquery').then(() => {
  $(document).ready(() => {
    $("img.a").hover(() => {
      $(this).stop().animate({"opacity": "0"}, "slow");
    }, () => {
      $(this).stop().animate({"opacity": "1"}, "slow");
    });
  });
});
</script>

Here the page depends upon a mouseover handler which depends upon jquery.
The handler and the page depend upon the image.


>
> ...
> >
> > If you don't want multiple round trips, import from a "bundle".
>
> That doesn't work; see the discussion in this e-mail:
>    https://mail.mozilla.org/pipermail/es-discuss/2014-August/038853.html


So I answered on another thread.

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


More information about the es-discuss mailing list