472,340 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,340 software developers and data experts.

Script output not appearing.

71
I have a script that shows the time and date. It's been working on my site for quite a while now. Suddenly it stops showing up, after getting my drop down menu to work.

If I put text between the <div id="datetime"></div> tags, the text shows up, but the javascript output being sent to those some divs doesn't seem to want to work. It should be showing up in the middle of the content pane, just below the first table box. (set by .css)

Here's the script:
Expand|Select|Wrap|Line Numbers
  1. //Original:  Xavier R. (xav@lougaou.com)
  2. //Modified:  Benjamin Wright, Editor
  3. //Web Site:  http://www.lougaou.com/
  4.  
  5. //This script and many more are available free online at The JavaScript Source!!
  6. //http://javascript.internet.com
  7.  
  8. var days = new Array("Sun, ","Mon, ","Tue, ","Wed, ","Thu, ","Fri, ","Sat, "); 
  9. var months = new Array("Jan ","Feb ","Mar ","Apr ","May ","Jun ", 
  10.                        "Jul ","Aug ","Sep ","Oct ","Nov ","Dec " ); 
  11.  
  12. function dt( ) 
  13.     // if browser doesn't support getElementById, 
  14.     // then it won't support CSS...so forget it 
  15.     if ( document.getElementById == null ) return; 
  16.     var dt = new Date(); 
  17.  
  18.     var hours = dt.getHours();     
  19.     var ampm = (hours > 11) ? " PM " : " AM "; 
  20.     if (hours > 12) hours -= 12; //If it's afternoon, subtract 12 to reset to 12hour scale. 
  21.     if (hours == 0) hours = 12;  //If it's midnight, show 12. 
  22.  
  23.     var now = hours + ":" + (100+dt.getMinutes()) + ":" + (100+dt.getSeconds()) + ampm + " "
  24.               + days[dt.getDay()] + months[dt.getMonth()] + dt.getDate() + ", " + dt.getFullYear(); 
  25.  
  26.     document.getElementById("datetime").innerHTML = now.replace( /\:1/g, ":" ); 
  27.  
  28.     setTimeout( "dt()", 1000 ); 
  29.  
  30. And here's a link to the page: http://rsteph49.tripod.com/default.shtml
  31.  
  32. Here's the code:
  33.  
  34. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  35. <html>
  36.  
  37.     <head>
  38.         <title>Clermont Christian Church</title>
  39.         <link href="styles.css" rel="stylesheet" type="text/css" />
  40.             <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
  41.             <meta name="description" content="This is the website homepage" />
  42.             <meta name="keywords" content="Christian, Indiana, Church, Clermont, Religion, Indianapolis, Sunday, School" />
  43.  
  44.             <style type="text/css" media="all">
  45.                 @import "style.css";
  46.             </style>
  47.  
  48. <script type="text/javascript" language="JavaScript1.2" src="/java_scripts/coolmenus4.js"></script>
  49. <script type="text/javascript" language="JavaScript1.2" src="/java_scripts/cm_addins.js"></script>
  50. <script type="text/javascript" language="javascript1.2" src="/java_scripts/sniffer.js">
  51.  
  52. /***********************************************
  53. * Top Navigational Bar III v3.5 (By BrotherCake- brothercake.com)
  54. * Exclusive permission by Dynamicdrive.com to include script in archive
  55. * For this and 100's more DHTML scripts, visit http://www.dynamicdrive.com/
  56. * This notice MUST stay intact for legal use
  57. ***********************************************/
  58.  
  59. </script>
  60.  
  61. <script type="text/javascript" language="javascript1.2" src="/java_scripts/basic_datetime.js"></script>
  62. <script type="text/javascript" language="javascript1.2" src="/java_scripts/custom.js"></script>
  63. <script type="text/javascript" language="javascript1.2" src="/java_scripts/style.js"></script>
  64.  
  65. </head>
  66.  
  67. <body id="body" onLoad="dt()">
  68.  
  69.     <div id="bannercontent">
  70.         <img src="/images/header.jpg" alt="" />
  71.     </div>
  72.  
  73.     <div id="menucontent">
  74.         <script type="text/javascript" language="javascript1.2" src="/java_scripts/menu.js"></script>
  75.     </div>
  76.  
  77.         <div id="datetime"></div>
  78.  
  79.         <div id="bodycontent">
  80.             <table border="0" cellpadding="25" cellspacing="0" bordercolor="#FF33FF" bgcolor="#ffffff" width="900" align="center">
  81.             <tr>
  82.                 <td align="left">
  83.                     <table border="8" cellpadding="0" cellspacing="0" align="center" bordercolor="#0000cc" bordercolordark="#000066" bordercolorlight="#0066ff">
  84.                     <tr>
  85.                         <td width="815" height="250" align="left" valign="top">
  86.                             <h1>Clermont Christian Church</h1>
  87.  
  88.                             <p>Welcome to our church&acute;s internet home!  You may have stopped here on purpose, or you may have gotten here by accident, but either way, we&acute;re glad you&acute;re here!</p>
  89.                             <br />
  90.                             <p>We are in the business of connecting people to God and connecting people to one another so that life can be all that God intends!  As you look around our site, we hope you&acute;ll find helpful information about CCC and get to know a little bit about who we are.  We&acute;d love to see you face to face sometime, so feel free to stop in to one of our services anytime, or introduce yourself as you see us out in the community.  We are praying for you!</p>
  91.                         </td>
  92.                     </tr>
  93.                     </table>
  94.                 </td>
  95.             </tr>
  96.  
  97.             <tr>
  98.                 <td>
  99.                 <table border="0" cellpadding="5" cellspacing="0" align="center" bordercolor="#ff00cc">
  100.                     <tr>
  101.                         <td width="400" height="400" align="center" valign="middle">
  102.                             <table border="8" cellpadding="0" cellspacing="0" align="center" bordercolor="#0000cc" bordercolordark="#000066" bordercolorlight="#0066ff"><tr><td width="400" height="400" align="center" valign="middle">
  103.                                 <img src="/images/christmasshow2.gif" align="absmiddle" border="0" alt="" />
  104.                             </td></tr></table>
  105.                         </td>
  106.                         <td width="400" height="400" align="center" valign="middle">
  107.                             <table border="8" cellpadding="0" cellspacing="0" align="center" bordercolor="#0000cc" bordercolordark="#000066" bordercolorlight="#0066ff"><tr><td width="400" height="400" align="center" valign="middle">
  108.                                 <img src="/images/services.gif" align="absmiddle"  border="0" alt="" />
  109.                             </td></tr></table>
  110.                         </td>
  111.                     </tr>
  112.  
  113.                     <tr>
  114.                         <td width="400" height="200" align="center" valign="middle">
  115.                             <table border="8" cellpadding="0" cellspacing="0" align="center" bordercolor="#0000cc" bordercolordark="#000066" bordercolorlight="#0066ff"><tr><td width="400" height="250" align="center" valign="middle">
  116.                                 <p class="announceHeader">Discovering Clermont #101:</p>
  117.                                 <p class="announceBody">Date: November 12<br />
  118.                                 Time: Immediately after the 10:30am service</p>
  119.                                 <p class="announceBody">This class is designed to introduce newcomers to our church's mission and ministry.</p>
  120.                                 <p class="announceHL" style="color: #990000">Lunch & Childcare will be provided</p>
  121.                             </td></tr></table>
  122.                         </td>
  123.                         <td width="400" height="200" align="center" valign="middle">
  124.                             <table border="8" cellpadding="0" cellspacing="0" align="center" bordercolor="#0000cc" bordercolordark="#000066" bordercolorlight="#0066ff"><tr><td width="400" height="250" align="center" valign="middle">
  125.                                 <p class="announceHeader">Thanksgiving Dinner</p>
  126.                                 <p class="announceBody">Date: November 19<br />
  127.                                 Time: Immediately after the 10:30am service</p>
  128.                                 <p class="announceBody">The dinner will be held in the Community Life Center, sign-up sheets are on the bulletin board in the foyer.</p>
  129.                                 <p class="announceHL">HELP IS REALLY NEEDED in some areas!!</p>
  130.                             </td></tr></table>
  131.                         </td>
  132.                     </tr>
  133.                 </table>
  134.                 </td>
  135.             </tr>
  136.  
  137.             </table>
  138.         </div>
  139.  
  140.         <div id="footer">
  141.     <p>Clermont Christian Church / Clermont, Indiana</p>
  142. </div>
  143.  
  144.  
  145.     </body>
  146.  
  147. </html>
  148. <!-- ********************************************************** -->
  149. <!-- * START TRIPOD AD CODE - PLEASE REMOVE WHEN EDITING PAGE * -->
  150. <!-- ********************************************************** -->
  151.  
  152. <!-- revision: new - $Change: 88678 $ -->
  153.  
  154. <script type="text/javascript" src="http://hb.lycos.com/hb.js"></script>
  155. <script type="text/javascript">
  156. var cm_role = "live";
  157. var cm_host = "tripod.lycos.com";
  158. var cm_taxid = "/memberembedded";
  159.  
  160. var lycos_ad_category = null;
  161.  
  162. var lycos_ad_remote_addr = "67.98.138.34";
  163. var lycos_ad_www_server = "www.tripod.lycos.com";
  164. var lycos_ad_track_small = "http://members.tripod.com/adm/img/common/ot_smallframe.gif?rand=200387";
  165. var lycos_ad_track_served = "http://members.tripod.com/adm/img/common/ot_adserved.gif?rand=200387";
  166. </script>
  167. <script type="text/javascript" src="http://scripts.lycos.com/catman/init.js"></script>
  168. <script type="text/javascript" src="http://members.tripod.com/adm/ad/code-start.js"></script>
  169. <script type="text/javascript" src="http://members.tripod.com/adm/ad/code-middle.js"></script>
  170. <script type="text/javascript" src="http://members.tripod.com/adm/ad/code-end.js"></script>
  171. <noscript>
  172. <img src="http://members.tripod.com/adm/img/common/ot_noscript.gif?rand=200387" alt="" width="1" height="1" />
  173. <img src="http://lycos.247realmedia.com/data/?tax0_SiteID=2&amp;nojs=true" alt="" width="1" height="1" />
  174. <a href="http://network.realmedia.com/RealMedia/ads/click_nx.ads/lycostripod/ros/728x90/wp/ss/a/200387@Top1?x"><img border="0" src="http://network.realmedia.com/RealMedia/ads/adstream_nx.ads/lycostripod/ros/728x90/wp/ss/a/200387@Top1" alt="leaderboard ad" /></a>
  175. </noscript>
  176.  
  177. <!-- revision: new - $Change: 88678 $ -->
  178.  
  179. <!-- ******************************************************** -->
  180. <!-- * END TRIPOD AD CODE - PLEASE REMOVE WHEN EDITING PAGE * -->
  181. <!-- ******************************************************** -->
  182.  
Nov 8 '06 #1
3 2306
ronverdonk
4,258 Expert 4TB
When you assume that I will wade through this bunch (180 lines) of unstructured code (not enclosed in code or html tags), you better think twice!

Ronald :cool:
Nov 8 '06 #2
rsteph
71
I'm sorry I've not posted that often on here before, and never used the code and html tags options that they have. Let me try reposting that here with those tags in place, see if that helps with reading it any.

When you assume that I will wade through this bunch (180 lines) of unstructured code (not enclosed in code or html tags), you better think twice!

Ronald :cool:
Nov 9 '06 #3
rsteph
71
I have a script that shows the time and date. It's been working on my site for quite a while now. Suddenly it stops showing up, after getting my drop down menu to work.

If I put text between the <div id="datetime"></div> tags, the text shows up, but the javascript output being sent to those some divs doesn't seem to want to work. It should be showing up in the middle of the content pane, just below the first table box. (set by .css)

Here's the script:

Expand|Select|Wrap|Line Numbers
  1.  
  2. //Original: Xavier R. (xav@lougaou.com)
  3. //Modified: Benjamin Wright, Editor
  4. //Web Site: http://www.lougaou.com/
  5.  
  6. //This script and many more are available free online at The JavaScript Source!!
  7. //http://javascript.internet.com
  8.  
  9. var days = new Array("Sun, ","Mon, ","Tue, ","Wed, ","Thu, ","Fri, ","Sat, "); 
  10. var months = new Array("Jan ","Feb ","Mar ","Apr ","May ","Jun ", 
  11. "Jul ","Aug ","Sep ","Oct ","Nov ","Dec " ); 
  12.  
  13. function dt( ) 
  14. // if browser doesn't support getElementById, 
  15. // then it won't support CSS...so forget it 
  16. if ( document.getElementById == null ) return; 
  17. var dt = new Date(); 
  18.  
  19. var hours = dt.getHours(); 
  20. var ampm = (hours > 11) ? " PM " : " AM "; 
  21. if (hours > 12) hours -= 12; //If it's afternoon, subtract 12 to reset to 12hour scale. 
  22. if (hours == 0) hours = 12; //If it's midnight, show 12. 
  23.  
  24. var now = hours + ":" + (100+dt.getMinutes()) + ":" + (100+dt.getSeconds()) + ampm + " "
  25. + days[dt.getDay()] + months[dt.getMonth()] + dt.getDate() + ", " + dt.getFullYear(); 
  26.  
  27. document.getElementById("datetime").innerHTML = now.replace( /\:1/g, ":" ); 
  28.  
  29. setTimeout( "dt()", 1000 ); 
  30.  
And here's a link to the page: http://rsteph49.tripod.com/default.shtml

Here's the code:

[HTML]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>

<head>
<title>Clermont Christian Church</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<meta name="description" content="This is the website homepage" />
<meta name="keywords" content="Christian, Indiana, Church, Clermont, Religion, Indianapolis, Sunday, School" />

<style type="text/css" media="all">
@import "style.css";
</style>

<script type="text/javascript" language="JavaScript1.2" src="/java_scripts/coolmenus4.js"></script>
<script type="text/javascript" language="JavaScript1.2" src="/java_scripts/cm_addins.js"></script>
<script type="text/javascript" language="javascript1.2" src="/java_scripts/sniffer.js">

/***********************************************
* Top Navigational Bar III v3.5 (By BrotherCake- brothercake.com)
* Exclusive permission by Dynamicdrive.com to include script in archive
* For this and 100's more DHTML scripts, visit http://www.dynamicdrive.com/
* This notice MUST stay intact for legal use
***********************************************/

</script>

<script type="text/javascript" language="javascript1.2" src="/java_scripts/basic_datetime.js"></script>
<script type="text/javascript" language="javascript1.2" src="/java_scripts/custom.js"></script>
<script type="text/javascript" language="javascript1.2" src="/java_scripts/style.js"></script>

</head>

<body id="body" onLoad="dt()">

<div id="bannercontent">
<img src="/images/header.jpg" alt="" />
</div>

<div id="menucontent">
<script type="text/javascript" language="javascript1.2" src="/java_scripts/menu.js"></script>
</div>

<div id="datetime"></div>

<div id="bodycontent">
<table border="0" cellpadding="25" cellspacing="0" bordercolor="#FF33FF" bgcolor="#ffffff" width="900" align="center">
<tr>
<td align="left">
<table border="8" cellpadding="0" cellspacing="0" align="center" bordercolor="#0000cc" bordercolordark="#000066" bordercolorlight="#0066ff">
<tr>
<td width="815" height="250" align="left" valign="top">
<h1>Clermont Christian Church</h1>

<p>Welcome to our church&acute;s internet home! You may have stopped here on purpose, or you may have gotten here by accident, but either way, we&acute;re glad you&acute;re here!</p>
<br />
<p>We are in the business of connecting people to God and connecting people to one another so that life can be all that God intends! As you look around our site, we hope you&acute;ll find helpful information about CCC and get to know a little bit about who we are. We&acute;d love to see you face to face sometime, so feel free to stop in to one of our services anytime, or introduce yourself as you see us out in the community. We are praying for you!</p>
</td>
</tr>
</table>
</td>
</tr>

<tr>
<td>
<table border="0" cellpadding="5" cellspacing="0" align="center" bordercolor="#ff00cc">
<tr>
<td width="400" height="400" align="center" valign="middle">
<table border="8" cellpadding="0" cellspacing="0" align="center" bordercolor="#0000cc" bordercolordark="#000066" bordercolorlight="#0066ff"><tr><td width="400" height="400" align="center" valign="middle">
<img src="/images/christmasshow2.gif" align="absmiddle" border="0" alt="" />
</td></tr></table>
</td>
<td width="400" height="400" align="center" valign="middle">
<table border="8" cellpadding="0" cellspacing="0" align="center" bordercolor="#0000cc" bordercolordark="#000066" bordercolorlight="#0066ff"><tr><td width="400" height="400" align="center" valign="middle">
<img src="/images/services.gif" align="absmiddle" border="0" alt="" />
</td></tr></table>
</td>
</tr>

<tr>
<td width="400" height="200" align="center" valign="middle">
<table border="8" cellpadding="0" cellspacing="0" align="center" bordercolor="#0000cc" bordercolordark="#000066" bordercolorlight="#0066ff"><tr><td width="400" height="250" align="center" valign="middle">
<p class="announceHeader">Discovering Clermont #101:</p>
<p class="announceBody">Date: November 12<br />
Time: Immediately after the 10:30am service</p>
<p class="announceBody">This class is designed to introduce newcomers to our church's mission and ministry.</p>
<p class="announceHL" style="color: #990000">Lunch & Childcare will be provided</p>
</td></tr></table>
</td>
<td width="400" height="200" align="center" valign="middle">
<table border="8" cellpadding="0" cellspacing="0" align="center" bordercolor="#0000cc" bordercolordark="#000066" bordercolorlight="#0066ff"><tr><td width="400" height="250" align="center" valign="middle">
<p class="announceHeader">Thanksgiving Dinner</p>
<p class="announceBody">Date: November 19<br />
Time: Immediately after the 10:30am service</p>
<p class="announceBody">The dinner will be held in the Community Life Center, sign-up sheets are on the bulletin board in the foyer.</p>
<p class="announceHL">HELP IS REALLY NEEDED in some areas!!</p>
</td></tr></table>
</td>
</tr>
</table>
</td>
</tr>

</table>
</div>

<div id="footer">
<p>Clermont Christian Church / Clermont, Indiana</p>
</div>


</body>

</html>
<!-- ************************************************** ******** -->
<!-- * START TRIPOD AD CODE - PLEASE REMOVE WHEN EDITING PAGE * -->
<!-- ************************************************** ******** -->

<!-- revision: new - $Change: 88678 $ -->

<script type="text/javascript" src="http://hb.lycos.com/hb.js"></script>
<script type="text/javascript">
var cm_role = "live";
var cm_host = "tripod.lycos.com";
var cm_taxid = "/memberembedded";

var lycos_ad_category = null;

var lycos_ad_remote_addr = "67.98.138.34";
var lycos_ad_www_server = "www.tripod.lycos.com";
var lycos_ad_track_small = "http://members.tripod.com/adm/img/common/ot_smallframe.gif?rand=200387";
var lycos_ad_track_served = "http://members.tripod.com/adm/img/common/ot_adserved.gif?rand=200387";
</script>
<script type="text/javascript" src="http://scripts.lycos.com/catman/init.js"></script>
<script type="text/javascript" src="http://members.tripod.com/adm/ad/code-start.js"></script>
<script type="text/javascript" src="http://members.tripod.com/adm/ad/code-middle.js"></script>
<script type="text/javascript" src="http://members.tripod.com/adm/ad/code-end.js"></script>
<noscript>
<img src="http://members.tripod.com/adm/img/common/ot_noscript.gif?rand=200387" alt="" width="1" height="1" />
<img src="http://lycos.247realmedia.com/data/?tax0_SiteID=2&amp;nojs=true" alt="" width="1" height="1" />
<a href="http://network.realmedia.com/RealMedia/ads/click_nx.ads/lycostripod/ros/728x90/wp/ss/a/200387@Top1?x"><img border="0" src="http://network.realmedia.com/RealMedia/ads/adstream_nx.ads/lycostripod/ros/728x90/wp/ss/a/200387@Top1" alt="leaderboard ad" /></a>
</noscript>

<!-- revision: new - $Change: 88678 $ -->

<!-- ************************************************** ****** -->
<!-- * END TRIPOD AD CODE - PLEASE REMOVE WHEN EDITING PAGE * -->
<!-- ************************************************** ****** -->
[/HTML]
Nov 9 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Madhav | last post by:
I have the following statements in my script. ---------------------------------------------------------- textToWrite = "<HTML> \n" + "<HEAD> \n" +...
11
by: Wentink | last post by:
Does anybody have a simple script that let's me popup a picture from a thumbnail? The ones i found are all very very complicated and messy in the...
8
by: Johnny Knoxville | last post by:
I've added a favicon to my site (http://lazyape.filetap.com/) which works fine if you add the site to favourites the normal way, but I have some...
5
by: Tushar | last post by:
hello all, i would like to know why this code compiles and gives the output Code 1: ---------- int main(){ printf("String" + 2); }
1
by: noleander | last post by:
Hi. I've got a C++ program written in Visual C++ 2003. The program is trivial, created with the Program-creation wizard: used the .NET "Form"...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0...
3
by: JR | last post by:
I'm experiencing a problem where, for seemingly no reason, trace output stops being logged (and appearing on my pages.) trace.enabled suddenly...
1
by: Adam Atlas | last post by:
(Apache/2.0.55, PHP/4.4.1) I am using an "Action" directive in my Apache configuration to map a certain file type (by means of AddType and...
5
by: lionel | last post by:
Hello, This is a simple script I test in a browser (firefox & opera) : echo "test 1<br />" ; sleep(3); echo "test 2<br />" ; I expected to...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
2
by: Matthew3360 | last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.