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:10:35 -0400
Message-ID: <op.u1v07xlj1ejg13@sandra-svwliu01>
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">

     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!");

Received on Friday, 16 October 2009 03:10:35 UTC

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