...

View Full Version : How to refresh a div



Vmusic
02-25-2006, 09:37 PM
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



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();

}

Kor
03-01-2006, 11:29 AM
You may use cloneNode(true) method... Do you need an example?

s3th
03-04-2012, 05:28 PM
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!

TooCrooked
03-04-2012, 07:07 PM
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.

s3th
03-04-2012, 08:56 PM
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

TooCrooked
03-05-2012, 01:28 AM
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.

s3th
03-05-2012, 05:09 AM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum