[whatwg] srcset javascript implementation (Respondu)

huperekchuno at googlemail.com huperekchuno at googlemail.com
Mon May 21 00:36:07 PDT 2012


Hey Julian

I believe the attribute sets are delimited by comma, whereas each attribute itself is separated by space?

The split is to load each attribute set into an array.

The actual attributes themselves are matched with regex's, to be more forgiving to the order.

Best regards,

Dave
------Original Message------
From: Julian Reschke
To: David Clements
Cc: whatwg at whatwg.org
Subject: Re: [whatwg] srcset javascript implementation (Respondu)
Sent: 21 May 2012 07:59

On 2012-05-21 04:21, David Clements wrote:
> Hi guys,
>
> Just to let you all know, I've written a javascript implementation of
> srcset using a framework for responsive images (which I also wrote)
> called Respondu (I'm open to new name suggestions), I'd love it if someone
> could check that I've implemented srcset right.
>
> Respondu manages to process the DOM without allowing any assets (contained
> in the body) to load, it also gracefully degrades for non-js
> browsers and is fairly unintrusive (it simply wraps the contents of the
> body tags).
>
> Check out the github page (feedback, pull requests, lunch money etc.
> welcome)
>
> https://github.com/davidmarkclements/Respondu
> ...

<https://github.com/davidmarkclements/Respondu/blob/master/R.js#L243>

This looks like you are splitting the attribute value by ","?

Best regards, Julian


Sent from my BlackBerry® smartphone on O2


More information about the whatwg mailing list