Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 06-26-2004, 10:49 AM   #1
Solid State Member
 
Join Date: Jun 2004
Posts: 9
Default Can I change script to load different pages for more than a week?

Can I tweak the script below so that I could change content for 9 days, 14 days, a month, etc?

<script language="JavaScript1.2">

//Daily iframe content- Dynamic Drive (www.dynamicdrive.com)
//For full source code, and Terms Of use, visit http://dynamicdrive.com
//This credit MUST stay intact for use

var ie=document.all&&navigator.userAgent.indexOf("Oper a")==-1
var dom=document.getElementById&&navigator.userAgent.i ndexOf("Opera")==-1

//Specify IFRAME display attributes
var iframeprops='width=150 height=150 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"'

//Specify 7 URLs to display inside iframe, one for each day of week
var daycontent=new Array()
daycontent[1]="monday.htm" //Monday content
daycontent[2]="tuesday.htm" //Tuesday content
daycontent[3]="wednesday.htm"
daycontent[4]="thursday.htm"
daycontent[5]="friday.htm"
daycontent[6]="saturday.htm"
daycontent[0]="sunday.htm"

//No need to edit after here
if (ie||dom)
document.write('<iframe id="dynstuff" src="" '+iframeprops+'></iframe>')

var mydate=new Date()
var mytoday=mydate.getDay()

function dayofweek_iframe(){
if (ie||dom){
var iframeobj=document.getElementById? document.getElementById("dynstuff") : document.all.dynstuff
iframeobj.src=daycontent[mytoday]
}
}

window.onload=dayofweek_iframe

</script>
thewolfe is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 02:03 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0