View Full Version : deleting a table and putting text
85882
03-19-2005, 04:09 PM
Ok, here is another question. Is it possible with Javascript to delete a table on a specific date and time and then put a text on the webpage that the table was deleted? And also, could there be a script that puts another table on a specific date and time onto the webpage? I know it's sounds complicated but maybe it will work when I put the actually table on a external .js file and then on a specific date and time it will then load that .js file into the webpage?
coothead
03-19-2005, 05:08 PM
Hi there 85882,
sure you could, using Jon Hanlon's script...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sremove table add text</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<style type="text/css">
/*<![CDATA[*/
#table {
width:486px;
margin:auto;
text-align:center;
}
#table table {
border:1px solid #000;
}
#table td{
width:486px;
height:300px;
border:1px solid #000;
font-family:verdana;
font-size:16px;
}
/*//]]>*/
</style>
<script type="text/javascript">
//<![CDATA[
function sendOff() {
var tTime = new Date("march 19, 2005 22:20:59");
var now = new Date();
if (now.getTime() >= tTime.getTime()) {
document.getElementById("table").innerHTML="this table is no more, it is terminated, it is text!!";
} else {
window.setTimeout("sendOff()",1000) // re-check in 1 sec
}
}
onload=sendOff;
//]]>
</script>
</head>
<body>
<div id="table">
<table><tr>
<td>this is a table</td>
</tr></table>
</div>
</body>
</html>
85882
03-20-2005, 08:31 PM
How about putting a table on a specific date and time instead of deleting it?
_Aerospace_Eng_
03-20-2005, 08:35 PM
you should really be prepared in knowing what it is exactly that you want, knowing what you want saves people time
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Sremove table add text</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
<style type="text/css">
/*<![CDATA[*/
#table {
width:486px;
margin:auto;
text-align:center;
}
#table table {
border:1px solid #000;
}
#table td{
width:486px;
height:300px;
border:1px solid #000;
font-family:verdana;
font-size:16px;
}
/*//]]>*/
</style>
<script type="text/javascript">
//<![CDATA[
function sendOff() {
var tTime = new Date("march 20, 2005 19:59:59");
var now = new Date();
if (now.getTime() >= tTime.getTime()) {
document.getElementById("table").innerHTML="<table><tr><td>This is a table</td></tr></table>";
} else {
window.setTimeout("sendOff()",1000) // re-check in 1 sec
}
}
onload=sendOff;
//]]>
</script>
</head>
<body>
<div id="table"></div>
</body>
</html>
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.