| 1. |
Solve : Change Image on a certain Day? |
|
Answer» How would I code a change to an image in html? I imageing that I would have to have it coded in javascript. But I hate to try an code it in java myself.This will help you, I'm not sure how to do the whole thing. I dont understand your code. You mightn't understand it, but it should work.Quote from: squall_01 on September 21, 2008, 06:59:37 AM How would I code a change to an image in html? People, SQUALLY wants it in CLIENT SIDE script, PHP is server side. I doubt that he's running a server. now, with that out of the way- he also wants to change an image. Now, this can't be done in HTML, but it can be done in Javascript. I don't have a good recollection, so anything I write here wouldn't work. Instead I think you could search dynamicdrive.com, they have some great scripts you can use in ADDITION to what your looking for, I'm sure. Just one last thing however. Quote from: squall_01 on September 21, 2008, 06:59:37 AM .... I would have to have it coded in javascript. But I hate to try an code it in java myself. Java and JavaScript are two DIFFERENT languages completely. Java is a compiled language DEVELOPED by Sun Microsystems. JavaScript was developed by netscape as "LiveScript" but they changed the name when they saw Java gaining fame. thats what I am saing. it would be a complete pain. yeah they should have something like that if I recall.any one taht run javascript instead of like php.Try this... Code: [Select]<script type="text/javascript"> var d=new Date(); var weekday=new Array(7); weekday[0]="Sunday"; weekday[1]="Monday"; weekday[2]="Tuesday"; weekday[3]="Wednesday"; weekday[4]="Thursday"; weekday[5]="Friday"; weekday[6]="Saturday"; if(weekday[d.getDay()]==0) { document.write("<img src='image1.gif' />"); } elseif(weekday[d.getDay()]==1) { document.write("<img src='image2.gif' />"); } elseif(weekday[d.getDay()]==2) { document.write("<img src='image3.gif' />"); } elseif(weekday[d.getDay()]==3) { document.write("<img src='image4.gif' />"); } elseif(weekday[d.getDay()]==4) { document.write("<img src='image5.gif' />"); } elseif(weekday[d.getDay()]==5) { document.write("<img src='image6.gif' />"); } elseif(weekday[d.getDay()]==6) { document.write("<img src='image5.gif' />"); } else { document.write("Can't tell what day it is!"); } ; </script> |
|