Puoi costruire l'elemento in modo dinamico attraverso il DOM di Javascript, è un po' laborioso in termini di righe di codice da scrivere ma funziona ed è valido:Originariamente inviato da superpelo
...
Data la presenza del tag <embed> non passa la validazione, ma se lo tolgo il palyer non funziona su FF..
Che si può fare?
Grazie!![]()
Non ho creato tutti e 6 gli elementi param, ma da quello che ho scritto puoi capire facilmente come fare.codice:<html> <head> <title>test</title> <script type="text/javascript"> <!-- function createMP() { var o = document.createElement('object'); o.setAttribute('id', 'mediaPlayer_1'); o.setAttribute('type', 'application/x-oleobject'); o.setAttribute('style', 'height:90px; width:280px;'); o.setAttribute('classid', 'CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6'); o.setAttribute('codebase', 'http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'); o.setAttribute('standby', 'Loading Microsoft® Windows® Media Player components...'); var p1 = document.createElement('param'); p1.setAttribute('name', 'URL'); p1.setAttribute('value', 'http://prova.it'); var p2 = document.createElement('param'); p2.setAttribute('name', 'SendPlayStateChangeEvents'); p2.setAttribute('value', 'false'); var p3 = document.createElement('param'); p3.setAttribute('name', 'AutoStart'); p3.setAttribute('value', 'true'); // etc etc... Fai questa pappardella per tutti e 6 gli elementi param var e = document.createElement('embed'); e.setAttribute('type', 'application/x-mplayer2'); e.setAttribute('src', 'prova.it'); e.setAttribute('style', 'height: 90px; width: 280px;'); o.appendChild(p1); o.appendChild(p2); o.appendChild(p3); // appendi tutti gli altri param che creerai... o.appendChild(e); document.getElementById('mpContainer').appendChild(o); } //--> </script> </head> <body> <div id="mpContainer"></div> Crea il lettore MP nel documento </body> </html>

Rispondi quotando