Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-07-2002, 10:02 PM   PM User | #1
mott85
New to the CF scene

 
Join Date: Aug 2002
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
mott85 is an unknown quantity at this point
Exclamation window by date

i need some help i saw a script for depending on what day of the month a diffrent message is displayed. But i need a script that dependiong on what day of the month a seperate window comes up. It also needs to have the option to open a window if there is no information for that day of the month. i have attached the script for displaying a messge dependin on days but i need the changes made please help asap.
here it is so far help me:

<form name="dailyinfo"><table border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="100%"><strong>Daily site news</strong><br>
<textarea rows="5" name="dailycontent" cols="40" wrap="virtual"></textarea></td>
</tr>
<tr>
<td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="50%"><a href="javascript:moreinfo()">More Information</a></td>
<td width="50%"><div align="right"><p><input type="text" name="cdate" size="9"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<p align="center"><font face="arial" size="-2">This free script provided by <a href="http://javascriptkit.com">JavaScript
Kit</a></font></p>
</td>
</tr>
</table>
</form>


<script>
<!--

/*
Daily information feed script
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/

var dailyinfo=new Array()
var dailyinfolink=new Array()

//define the messages below, where the first one is for the 1st of this month, second is for the 2nd of this month, and so on. You do NOT have to define all of them at once. For example, you can just define enough to cover up to a week.

dailyinfo[1]=''
dailyinfo[2]=''
dailyinfo[3]=''
dailyinfo[4]=''
dailyinfo[5]=''
dailyinfo[6]=''
dailyinfo[7]=''
dailyinfo[8]=''
dailyinfo[9]=''
dailyinfo[10]=''
dailyinfo[11]=''
dailyinfo[12]=''
dailyinfo[13]=''
dailyinfo[14]=''
dailyinfo[15]=''
dailyinfo[16]=''
dailyinfo[17]=''
dailyinfo[18]=''
dailyinfo[19]=''
dailyinfo[20]=''
dailyinfo[21]=''
dailyinfo[22]=''
dailyinfo[23]=''
dailyinfo[24]=''
dailyinfo[25]=''
dailyinfo[26]=''
dailyinfo[27]=''
dailyinfo[28]='Message for the 28th of this month goes here'
dailyinfo[29]='Message for the 29th of this month goes here'
dailyinfo[30]='Message for the 30th of this month goes here'
dailyinfo[31]=''

//if any one of the daily messages above should click through to a URL, specify them here:
dailyinfolink[28]="http://dynamicdrive.com"
dailyinfolink[29]="http://news.com"

var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()+1
if (month<10)
month="0"+month
var daym=mydate.getDate()

document.dailyinfo.cdate.value=month+"/"+daym+"/"+year
document.dailyinfo.dailycontent.value=dailyinfo[daym]

function moreinfo(){
if (dailyinfolink[daym])
window.location=dailyinfolink[daym]
else
alert("No additional information available for this news piece")
}

//-->
</script>
mott85 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:05 AM.


Advertisement
Log in to turn off these ads.