06-08-2004, 03:05 PM
Is there a way to do this without any CGI stuff? I don't have access to the server, so it all has to be client-side.
06-08-2004, 05:09 PM
how are you accomplishing this in the Java applet? Are the text files named by the date...are you calculating some factor based on date or does it matter as long as their is one per day?
06-08-2004, 06:40 PM
Unfortunately I don't know exactly how the Applet works...I've just started working here and don't have access to a lot of things. But yes, each "this day in history" item is housed in a separate .txt file, named as 0608.txt, etc.
06-09-2004, 05:14 AM
06-09-2004, 06:04 AM
Use this script (http://www.codingforums.com/showthread.php?t=30449) to get the content of the text file
font:normal 12px Arial;
//generate path from today's date
var today = new Date();
var mm = today.getMonth()+1;
if (mm<10) mm="0"+mm;
var dd = today.getDate();
if (dd<10) dd="0"+dd;
var path = ""+mm+dd+".txt"; //this means that the txt file is in the same folder as this html file, add subdirectory (if any) or put the absolute path
//get content of txt file
var content = getFile(path);
var histDiv = document.getElementById('hist');
histDiv.innerHTML += '<p><pre class="history">' + historyItem + '</pre></p>';
histDiv.style.display = "block";
window.onload = displayHistory; //combine onload if you have an existing onload handler
<div id="hist" style="display:none">
<h2>This day in history</h2>
You missed the "This day in history" section.
Don't forget to add the script I referred above.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.