Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Jun 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,960
    Thanks
    0
    Thanked 236 Times in 233 Posts
    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='';

  • #3
    New Coder
    Join Date
    May 2004
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts
    or u can just use appendChild... go search for "appendChild javascript" in google.com. that helped me :P

  • #4
    New Coder
    Join Date
    Jun 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,960
    Thanks
    0
    Thanked 236 Times in 233 Posts

  • #6
    New Coder
    Join Date
    Jun 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,960
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Have you read the link I posted?

  • #8
    New Coder
    Join Date
    Jun 2004
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •