W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2010

[whatwg] Javascript: URLs as element attributes

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Wed, 01 Dec 2010 10:29:36 -0500
Message-ID: <4CF669E0.7010400@mit.edu>
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.

Received on Wednesday, 1 December 2010 07:29:36 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:28 UTC