Re: help on removing element using yui



Hi Shotokan,


If you want to remove the element you just added. Then you need to
find te object. and get its parent.

var obj =document.getElementById('mplayer');
obj.parentNode.removeChild(obj);




On Aug 30, 6:08 am, shotokan99 <soft_devj...@xxxxxxxxx> wrote:
just a basic question. i added an element on my page using javascript,
that goes like this:

var r=document.getElementById('d_main');
var k=document.createElement('object');
k.setAttribute('id','mplayer');
k.setAttribute('width','320');
k.setAttribute('height','286');
k.setAttribute('classid','CLSID:22D6f312-
B0F6-11D0-94AB-0080C74C7E95');
k.setAttribute('standby','Loading Windows Media Player
components...');
k.setAttribute('type','application/x-oleobject');
k.setAttribute('codebase','http://activex.microsoft.com/activex/
controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112');
k.innerHTML='<param name="Showcontrols" value="True"><embed src="../
movie/Madagascar.avi" width=320 height=240 type="application/x-
mplayer2" name="MediaPlayer"></embed>';
r.appendChild(k);

actually its a windows media player ;-) now is it possible to remove
the element using yui method such as purgeElement() , etc? if so, can
someone pls give me a code snippet on how to do it.

tnx.


.



Relevant Pages

  • WSH script conversion
    ... // This is a simple JavaScript WSH script to display the currently playing media for ... // Windows Media Player 9 Series when the Blogging Plug-in is installed. ... var strDisplayString; ...
    (microsoft.public.scripting.wsh)
  • help on removing element using yui
    ... just a basic question. ... i added an element on my page using javascript, ... var r=document.getElementById; ... k.setAttribute('standby','Loading Windows Media Player ...
    (comp.lang.javascript)
  • pls help....media player wont play
    ... i wanted to embed on my page windows media player on run-time. ... browser is ie, and my code goes like this: ... var r=document.getElementById; ... video. ...
    (comp.lang.javascript)
  • Re: OOP, object literal notation, and the new operator - how to have multiple child objects of a
    ... to have multiple child objects of a parent object. ... calling 'var firstChild = parentObj.childObj.init; ... you wish to apply the principle of encapsulation in your development. ...
    (microsoft.public.scripting.jscript)
  • Re: Making a Linked List
    ... Pass $parent by reference, and assign it to the class variable using =&. ... >> languages, I might use a pointer array to other pointer arrays, but in ... > var $parent; ...
    (comp.lang.php)