W3C home > Mailing lists > Public > whatwg@whatwg.org > October 2009

[whatwg] <object> behavior

From: Michael A. Puls II <shadow2531@gmail.com>
Date: Fri, 16 Oct 2009 06:48:30 -0400
Message-ID: <op.u1v2y4yf1ejg13@sandra-svwliu01>
On Fri, 16 Oct 2009 06:19:04 -0400, Simon Pieters <simonp at opera.com> wrote:

> On Fri, 16 Oct 2009 12:10:35 +0200, Michael A. Puls II  
> <shadow2531 at gmail.com> wrote:
>
>> On Fri, 16 Oct 2009 05:28:46 -0400, Ian Hickson <ian at hixie.ch> wrote:
>>
>>> There was also some discussion of what to do about preventing a plugin
>>> instantiating. It seems to me that authors can do that by not creating  
>>> the
>>> <object> element ahead of time.
>>
>> And, if it's desired to specify the <object> via parsed markup (as  
>> opposed to doing it all with JS), one can omit @type and @data so  
>> things don't load and add them later like so:
>>
>> <object style="display: none"  
>> data-load-on-demand-type="application/x-java-applet" id="test">
>>      <param name="code" value="MyJavaClass">
>>      fallback
>> </object>
>>
>> <script>
>>      window.onload = function() {
>>          var obj = document.getElementById("test");
>>          obj.style.display = "inline-block";
>>          obj.type = obj.dataset["load-on-demand-type"];
>>          alert("Come alive! Hide your fallback! I command you!");
>>      };
>> </script>
>
> "One or both of the data and type attributes must be present." says the  
> spec.

Oops. Right. Forgot about that.

> <embed> doesn't seem to have the same requirement for src and type.  
> (Also compare with img, iframe, video...)
>


-- 
Michael
Received on Friday, 16 October 2009 03:48:30 UTC

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