JRS: In article <dt**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com>,
dated Tue, 21 Feb 2006 05:11:40 remote, seen in
news:comp.lang.javascript, Bart Simpson <ea*********@springfield.com>
posted :
Is it possible to update only certain portions of a web page (without
uploading/refreshing the entire page)?.
I have a table displayed in a web page, and I would like to be able to
update the data in the table, cell by cell. That is to say, I could have
a function like so:
function updateCell(tablename, column_number, row_number) {
/* what goes here ? */
}
I suspect that the DOM (which I know next to nothing about), comes to
play here.
Posting under a false name shows a juvenile attitude. Posting with an
address that you do not have the right to use is an abuse of someone
else's resources, and against the AUP of respectable ISPs. Articles
should have meaningful Subject lines. Read the newsgroup FAQ.
You do not say where the new data is coming from. If it is coming from
a remote server, you may want to use AJAX. But if it can be generated
locally, then the matter can be handled without re-contacting the
server; here is a near-minimal example :-
<BODY>
<script type="text/javascript">
if (document.all && !document.getElementById) { // e.g. IE4
document.getElementById = function(id) {
return document.all[id] } }
function X() { document.getElementById("Y").innerHTML = new Date() }
</script>
<table border=1><tr><td ID=Y>target</td></tr></table>
<button onClick="X()">xxx</button>
</BODY>
Read the newsgroup FAQ; see below.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.