Computing.Net > Forums > Web Development > Can I change script to load more

Can I change script to load more

Reply to Message Icon

Original Message
Name: thewolfe
Date: June 26, 2004 at 07:49:19 Pacific
Subject: Can I change script to load more
OS: Win XP
CPU/Ram: Pent111/512
Comment:

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("Opera")==-1
var dom=document.getElementById&&navigator.userAgent.indexOf("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>


Report Offensive Message For Removal

Response Number 1
Name: Jamie_McCoy
Date: June 26, 2004 at 09:28:06 Pacific
Subject: Can I change script to load more
Reply: (edit)

you would want to change day to date

their for u cud have

if day = 1
if day = 2
if day = 3
if day = ....
if day = 28

what are you chaging based on day? what is in these monday.htm etc

maybe PHP would work best since its all server side

Regards, Jamie McCoy


Report Offensive Follow Up For Removal

Response Number 2
Name: thewolfe
Date: June 26, 2004 at 10:57:58 Pacific
Subject: Can I change script to load more
Reply: (edit)

Just diffeerent text.


Report Offensive Follow Up For Removal

Response Number 3
Name: Jamie_McCoy
Date: June 26, 2004 at 16:33:43 Pacific
Subject: Can I change script to load more
Reply: (edit)

PHP wud actually be a lot easy

you dont even need to have whole seperate docuemtns either

just use the date funtion to get your randomised generator and have it say

if date = whatever then echo text

i can write you it if u wanted, just email me

Jaymc.co.nr


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Can I change script to load more

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software