...

View Full Version : document.body.removeChild . Do I have to reload the page? Help! please



mx-guest2004
06-13-2004, 03:34 PM
(I'm not so good in javascript programming)
I have disabled an embeded object by document.body.removeChild(ref);
It works but to call the function which embed the object AGAIN, I have to reload the page.
Is there any better solution? I don't want to reload the page.


mx-guest2004

glenngv
06-14-2004, 07:41 AM
You don't have to reload. Please show us the code.

But why not just hide it and then show it later?

//hide
ref.style.display='none';

//show
ref.style.display='';

guowei1000
06-14-2004, 08:11 AM
or u can just use appendChild... go search for "appendChild javascript" in google.com. that helped me :P

mx-guest2004
06-14-2004, 12:59 PM
glenngv,
The problem is that ref.style.display='none' doesn,t work on sound. The panel disappears but not the sound.
I have 2 buttons:
music ON
music OFF
and I want the user is free to choose these buttons OVER AND OVER AGAIN
mx-guest2004 :)

glenngv
06-14-2004, 01:29 PM
http://www.javascripter.net/faq/sound/

mx-guest2004
06-15-2004, 07:12 AM
Ok. I chose the wrong way and it works :thumbsup:
I had a function for embedding the object. This one been called by the "music on" button.
I made a function exactly the same function (with out any conditions etc. ) which embed an object which has hidden="true" and a src that doesn't exist.
This function been called with "music off".

This is maybe not the best way. But I just wanted to give user an extra option. The control keys for the music are actually on the player panel.
mx-guest2004 :)

glenngv
06-15-2004, 07:31 AM
Have you read the link I posted?

mx-guest2004
06-15-2004, 08:19 AM
Yes glenngv, thanks for that link. I got the idea there, but not 100% because I had another program structure. So it became a combination of his idea and mine.
mx-guest2004



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum