[whatwg] Javascript: URLs as element attributes

Boris Zbarsky bzbarsky at MIT.EDU
Wed Dec 1 07:29:36 PST 2010


On 12/1/10 3:49 AM, Philip Jägenstedt wrote:
> Given that the feature can't be made completely consistent for security
> reasons, I guess it comes down to use cases. Are there solid use cases
> for using the return values of sandboxed scripts as the content of
> documents, that aren't equally well served by the data: protocol?

I dunno about solid, but the obvious things you can do with javascript: 
that you can't do as easily with data: are things that are dynamic. 
That said, in a sandbox the only things that are available as obvious 
sources of dynamism are |new Date| and |Math.random|.  So achieving 
solidity might take some work.  ;)

Oh, the other thing that JavaScript can do that data: can't do is trade 
off url length for CPU time.  A data: URI to write out the first 3000 
Fibonacci numbers would be a lot longer than the equivalent javascript: 
URI.  Again, one would have to find non-silly use cases here.

-Boris




More information about the whatwg mailing list