Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-13-2004, 02:34 PM   PM User | #1
mx-guest2004
New Coder

 
Join Date: Jun 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
mx-guest2004 is an unknown quantity at this point
document.body.removeChild . Do I have to reload the page? Help! please

(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
mx-guest2004 is offline   Reply With Quote
Old 06-14-2004, 06:41 AM   PM User | #2
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
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='';
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 06-14-2004, 07:11 AM   PM User | #3
guowei1000
New Coder

 
Join Date: May 2004
Posts: 51
Thanks: 0
Thanked 0 Times in 0 Posts
guowei1000 is an unknown quantity at this point
or u can just use appendChild... go search for "appendChild javascript" in google.com. that helped me :P
guowei1000 is offline   Reply With Quote
Old 06-14-2004, 11:59 AM   PM User | #4
mx-guest2004
New Coder

 
Join Date: Jun 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
mx-guest2004 is an unknown quantity at this point
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

Last edited by mx-guest2004; 06-14-2004 at 12:01 PM..
mx-guest2004 is offline   Reply With Quote
Old 06-14-2004, 12:29 PM   PM User | #5
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
http://www.javascripter.net/faq/sound/
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 06-15-2004, 06:12 AM   PM User | #6
mx-guest2004
New Coder

 
Join Date: Jun 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
mx-guest2004 is an unknown quantity at this point
Ok. I chose the wrong way and it works
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
mx-guest2004 is offline   Reply With Quote
Old 06-15-2004, 06:31 AM   PM User | #7
glenngv
Supreme Master coder!


 
glenngv's Avatar
 
Join Date: Jun 2002
Location: Los Angeles, CA Original Location: Philippines
Posts: 10,241
Thanks: 0
Thanked 112 Times in 111 Posts
glenngv will become famous soon enough
Have you read the link I posted?
__________________
Glenn
_____________________________________________
Play Tower of Hanoi Android app (Ad-FREE!)
Play Tower of Hanoi Android app (FREE!)
Go to Tower of Hanoi Leaderboard
Play Tower of Hanoi Facebook app
glenngv is offline   Reply With Quote
Old 06-15-2004, 07:19 AM   PM User | #8
mx-guest2004
New Coder

 
Join Date: Jun 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
mx-guest2004 is an unknown quantity at this point
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
mx-guest2004 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:33 PM.


Advertisement
Log in to turn off these ads.