|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
quick javascript advice needed
Hi i have two sets of script to put clocks on my website, one shows the time in my customers timezone and the other shows the time related to my website (time in Thailand)
The problem is when i put them both into my dreamweaver webpage only one will show at a time. How can i change the scripts so both can show at the same time? here is one of the scripts <!-- Clock Part 1 - Holder for Display of Clock --> <span id="tP"> </span> <!-- Clock Part 1 - Ends Here --> <!-- Clock Part 2 - Put Anywhere AFTER Part 1 --> <script type="text/javascript"> // Clock Script Generated By Maxx Blade's Clock v2.0d // http://www.maxxblade.co.uk/clock function tS(){ x=new Date(tN().getUTCFullYear(),tN().getUTCMonth(),tN() .getUTCDate(),tN().getUTCHours(),tN().getUTCMinute s(),tN().getUTCSeconds()); x.setTime(x.getTime()+25200000); return x; } function tN(){ return new Date(); } function lZ(x){ return (x>9)?x:'0'+x; } function tH(x){ if(x==0){ x=12; } return (x>12)?x-=12 function dE(x){ if(x==1||x==21||x==31){ return 'st'; } if(x==2||x==22){ return 'nd'; } if(x==3||x==23){ return 'rd'; } return 'th'; } function dT(){ document.getElementById('tP').innerHTML=eval(oT); setTimeout('dT()',1000); } function aP(x){ return (x>11)?'pm':'am'; } function y4(x){ return (x<500)?x+1900 var dN=new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat'),m N=new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','A ug','Sep','Oct','Nov','Dec'),oT="dN[tS().getDay()]+' '+tS().getDate()+dE(tS().getDate())+' '+mN[tS().getMonth()]+' '+y4(tS().getYear())+' '+':'+':'+' '+tH(tS().getHours())+':'+lZ(tS().getMinutes())+': '+lZ(tS().getSeconds())+' '+aP(tS().getHours())"; if(!document.all){ window.onload=dT; }else{ dT(); } </script> <!-- Clock Part 2 - Ends Here --> any help is appreciated |
|
#2
|
|||
|
|||
|
RE: quick javascript advice needed
just to clarify something you mean it doesnt work in the browser? cause that dreamweaver part got me a bit confused
|
|
#3
|
|||
|
|||
|
RE: quick javascript advice needed
Hi thanks for your reply
basically i have this code twice, one makes a clock that shows the GMT time + 7 hrs, the other takes the local time of the person viewing my website. (same code but edited to suit the two timezones) i use Dreamweaver to make my webpages and i have put the two seperate clocks into two seperate cells of a table. but whenever i try to view the clocks in a browser only one will ever show, i presume there is something conflicting where two instances of this code cant work together in one html file. I hope this makes sence to you! again thanks for any help |
|
#4
|
|||
|
|||
|
Message Moved
Thread moved from 'Support and Suggestions' to 'Client Side Things' by tkarkkainen.
Reason: Not a problem with Codewalkers |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > quick javascript advice needed |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|