Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I needed to do this same thing and simply place all of the HTML needed for the OBJECT tag in a string in JavaScript and simply replace the innerHTML of a div tag with the OBJECT HTML and it works in IE just fine.</p> <pre><code>// something akin to this: document.getElementById(myDivId).innerHTML = "&lt;OBJECT id='foo' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'.....etc"; </code></pre> <p>That should work, it does just fine for me - I use it to embed Windows Media Player in a page.</p> <hr> <p>UPDATE: You would run the above code after the page loads via an event handler that either runs on the page's load event or maybe in response to a user's click. The only thing you need to do is have an empty DIV tag or some other type of tag that would allow us to inject the HTML code via that element's <code>innerHTML</code> property.</p> <hr> <p>UPDATE: Apparently you need more help than I thought you needed? Maybe this will help:</p> <p>Have your BODY tag look like this: <code>&lt;body onload="loadAppropriatePlugin()"&gt;</code></p> <p>Have somewhere in your page, where you want this thing to load, an empty DIV tag with an <code>id</code> attribute of something like "Foo" or whatever.</p> <p>Have code like this in a <code>&lt;script&gt;</code> tag in your <code>&lt;head&gt;</code> section:</p> <pre><code>function getIEVersion() { // or something like this var ua = window.navigator.userAgent; var msie = ua.indexOf("MSIE "); return ((msie &gt; 0) ? parseInt(ua.substring(msie+5, ua.indexOf(".", msie))) : 0); } function loadAppropriatePlugin() { if(getIEVersion() != 0) { // this means we are in IE document.getElementById("Foo").innerHTML = "&lt;OBJECT id='foo' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95'.....etc"; } else { // if you want to maybe do the same for FF and load that stuff... } } </code></pre> <p>Does that help?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload