Im sure one of you will see a mistake in a second but im trying to do this and I need help. The date and time nor the text will appear on the screen when I open it up in the browser.
<SCRIPT LANGUAGE="javascript">
//Coded by indy
RightNow = getDate();
document.write
("<FONT COLOR='GREEN'>Welcome! You stopped by on:</FONT> " + (RightNow.getMonth()+1) + "/" + RightNow.getDate() + "/" + RightNow.getFullYear() ")
</SCRIPT>
This wont be the only question I have in my quest to learn JS so if anyone could help I would greatly appreciate it :)
wolfy
11-09-2004, 12:44 AM
You need to place " " at the beginning and end. "Welcome -----on:"
You're right I forget sometimes myself.
I dont know if anything else is wrong.
I am just learning also.
Wolfy :)
It still doesnt work :(
Heres what I have now :
<SCRIPT type="text/javascript">
//Coded by Zach Day
RightNow = getDate();
document.write
("<FONT COLOR='GREEN'>"Welcome! You stopped by on:"</FONT> " + (RightNow.getMonth()+1) + "/" + RightNow.getDate() + "/" + RightNow.getFullYear()")
</SCRIPT>
Willy Duitt
11-09-2004, 01:09 AM
<SCRIPT type="text/javascript">
//Coded by Zach Day
RightNow = new Date();
document.write
("<FONT COLOR='GREEN'>"Welcome! You stopped by on:"</FONT> " + (RightNow.getMonth()+1) + "/" + RightNow.getDate() + "/" + RightNow.getFullYear()")
</SCRIPT>
.....Willy
c1lonewolf
11-09-2004, 01:13 AM
The first time you posted it:
<SCRIPT LANGUAGE="javascript">
//Coded by indy
RightNow = getDate();
document.write
("<FONT COLOR='GREEN'>Welcome! You stopped by on:</FONT> " + (RightNow.getMonth()+1) + "/" + RightNow.getDate() + "/" + RightNow.getFullYear() ")
</SCRIPT>
you just needed to change getDate() to new Date()
and the last parenthese? you don't need it.
<SCRIPT LANGUAGE="javascript">
RightNow = new Date();
document.write("<FONT COLOR='GREEN'>Welcome! You stopped by on:</FONT>" +(RightNow.getMonth()+1) + "/" +RightNow.getDate()+ "/"+RightNow.getFullYear()) // no parenthese after fullyear()
</SCRIPT>
The first time you posted it:
<SCRIPT LANGUAGE="javascript">
//Coded by indy
RightNow = getDate();
document.write
("<FONT COLOR='GREEN'>Welcome! You stopped by on:</FONT> " + (RightNow.getMonth()+1) + "/" + RightNow.getDate() + "/" + RightNow.getFullYear() ")
</SCRIPT>
you just needed to change getDate() to new Date()
and the last parenthese? you don't need it.
<SCRIPT LANGUAGE="javascript">
RightNow = new Date();
document.write("<FONT COLOR='GREEN'>Welcome! You stopped by on:</FONT>" +(RightNow.getMonth()+1) + "/" +RightNow.getDate()+ "/"+RightNow.getFullYear()) // no parenthese after fullyear()
</SCRIPT>
Thanks lone Wolf :D
It works now, thanks guys