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 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to refresh a div

    Hi,
    I have a javascript that adds a table to a div with an onClick event. The script works fine.... but I also want it remove the table, and then refresh the div

    The refresh doesn't work - you can still see the table

    What's the right way to make it so after you do the removeChild -the table doesn't show

    Thanks
    Vmusic

    Code:
    else ///else the person unChecked the check box
    {
    	alert('The check box IS NOW unchecked');
    	curDiv = document.getElementById(divID);
    	var tbl_toRemove = document.getElementById('25Glory');
    	curDiv.removeChild(tbl_toRemove); 
    	curDiv.refresh();		
    
    }

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    You may use cloneNode(true) method... Do you need an example?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Mar 2012
    Location
    Targu Mures
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hey there...i want the same thing...to refresh a table using javascript and without refreshing the whole page...the div i want to refresh is for my browsergame.
    The table code is:
    $output['html'] .= '<table width="800" height="600" border="1" bordercolor="000000" background="' . $config['img_url'] . '/background/' . $db->dsan($sector['bg']) . '.gif">';
    Please help!

  • #4
    New Coder
    Join Date
    Aug 2009
    Location
    Dirty Jersey
    Posts
    30
    Thanks
    0
    Thanked 2 Times in 2 Posts
    there's no such thing as "refreshing" an element (whether that element be a div, table, or otherwise). there's modifying an elements current state (and/or contents), however.

    that said, can you restate how you want to modify your table? from your snippet, i see that you use PHP to create a table with a PHP invoked background. there's nothing else that the code tells me, so i can't extrapolate further.

  • #5
    New to the CF scene
    Join Date
    Mar 2012
    Location
    Targu Mures
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by TooCrooked View Post
    there's no such thing as "refreshing" an element (whether that element be a div, table, or otherwise). there's modifying an elements current state (and/or contents), however.

    that said, can you restate how you want to modify your table? from your snippet, i see that you use PHP to create a table with a PHP invoked background. there's nothing else that the code tells me, so i can't extrapolate further.
    so...i dont want to use meta to refresh all the page content...i want just that table to be refreshed(updated) witouth refreshing all the content of the page.
    I need that for my browser game..I could use jquery but im not a javascript programmer ...i use php...so i need a kind of javascript to update all the time that table whitout refreshing all the content of my webpage

  • #6
    New Coder
    Join Date
    Aug 2009
    Location
    Dirty Jersey
    Posts
    30
    Thanks
    0
    Thanked 2 Times in 2 Posts
    you may be in over your head here. you'd have to craft a specially designed AJAX script to allow javascript to request information for your PHP programs and dynamically insert that information into your webpage. there's no "standard" way to do this because your program is unique. you'd have to learn how javascript works enough to use AJAX.

  • #7
    New to the CF scene
    Join Date
    Mar 2012
    Location
    Targu Mures
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Quote Originally Posted by TooCrooked View Post
    you may be in over your head here. you'd have to craft a specially designed AJAX script to allow javascript to request information for your PHP programs and dynamically insert that information into your webpage. there's no "standard" way to do this because your program is unique. you'd have to learn how javascript works enough to use AJAX.
    ok ,thank you


  •  

    Posting Permissions

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