Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
problem with time script
Old 11-10-2005, 05:47 PM problem with time script
Novice Talker

Posts: 6
Trades: 0
hi all !!
i won;t to this script say (beetwen 12 and 22) say sth and after this it will say sth defferent this is what i done:

in head:
Code:
<script>
var dayarray=new Array("Poniedziałek","Wtorek","Środa","Czwartek","Pištek","Sobota","Niedziela")

function pobieraniedaty(){
var mydate=new Date()
var day=mydate.getDay()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var hours=mydate.getHours()
var minutes=mydate.getMinutes()
var seconds=mydate.getSeconds()
var timeValue = ((hours<12)?"Nie przyjmujemy Już zamówień":(hours<22)?"Kuchnia jest otwarta więc zamawiaj")
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
// zmiana czcionki
var cdate="<center><font size='3' color='Black' face='Arial'><b>"+dayarray+" <br>"+hours+":"+minutes+":"+seconds+ "<br>" +timeValue+"</b></font></center>"
if (document.all)
document.all.clock.innerHTML=cdate
else if (document.getElementById)
document.getElementById("clock").innerHTML=cdate
else
document.write(cdate)
}
if (!document.all&&!document.getElementById)
getthedate()
function zegar(){
if (document.all||document.getElementById)
setInterval("pobieraniedaty()",1000)
}
</script>
in body:
Code:
<body onLoad="zegar()">
and where it should be:
Code:
<p><span id="clock"></span></p>
plis help fast i realy need it

thx
MightyDeamon is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-18-2005, 02:48 PM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
Your syntax is all wrong, you are missing the {} brackets, like this:[code]
Code:
if (x==y) {
     alert("yes, ex equals y");
}
Also try indenting your code to make it more readable.
funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Reply     « Reply to problem with time script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.09596 seconds with 12 queries