views:

236

answers:

1

Here is the HTC content I'm encoding (nothing fancy):

<public:component>
  <script type="text/javascript">
    alert('data URI');
  </script>
</public:component>

Here is the definition in the CSS file, with the above component base64'd:

.something
{
  -ms-behavior: url(data:text/x-component;base64,PHB1YmxpYzpjb21wb25lbnQ+PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPmFsZXJ0KCdiYXNlNjQnKTs8L3NjcmlwdD48L3B1YmxpYzpjb21wb25lbnQ+);
}

Doesn't seem to work...although when I save the above component to a file, and reference it in the behavior property, I get my alert. I remember an announcement that behaviors could now be housed in data URIs in IE8...I thought that was the trade off for taking dynamic properties (CSS expressions) away from us. Is this wrong?

+2  A: 

No, DATA URIs were not added to compensate for the removal of CSS expressions.

Supported only in IE8 Standards Mode pages, Data URIs are limited to 32kb in length, and cannot be used for script-execution or navigation purposes.

If you look in the IE8 error console, you'll see:

Webpage error details Message: Access is denied to: data:text/x-component;base64,PHB1YmxpYzp...

EricLaw -MSFT-
Not the answer I wanted, but I guess I have to accept it...
Frank Edwards