I am new to JavaScript programming and need help getting my code to display correctly. Here is the code:
<HTML>
<HEAD>
<TITLE>Fun with Phonics</TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--Hide from old browsers
function chngSite() {
alert("You are about to be transported to the new site location!")
location = "http://www.scsite.com/"
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<CENTER><IMG SRC="fun.jpg" HSPACE=5 VSPACE=5 HEIGHT=64 WIDTH=129></CENTER>
<CENTER><HR Width="75%"></CENTER>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--Hide from old browsers
document.bgColor="red"
document.bgColor="white"
document.bgColor="blue"
document.bgColor="white"
document.bgColor="green"
document.bgColor="white"
document.bgColor="blanchedalmond"
var tNow = new Date()
var tlocDate = tNow.toLocaleString()
var tDate = tlocDate.substring(0,10)
document.write("<H2><CENTER>Welcome, today is "+tDate+"</CENTER></H2>")
var intro1 = "Hi, thanks for visiting our Web site, but we have moved. Please make a note "
var intro2 = "of our new URL (http://www.funphonics.com) and notify the Webmaster about our new "
var intro3 = "location. Click<A Href='http://www.scsite.com/'> here </A> or wait 15 seconds "
var intro4 = "to be moved automatically to our new site."
var introMsg = intro1+intro2+intro3+intro4
document.write("<H4><FONT Color='firebrick'>"+introMsg+"</H4></FONT>")
setTimeout("chngSite()",15000)
document.write("<BR><H4><CENTER>This document was last modified "+document.lastModified+"</CENTER></H4>")
//-->
</SCRIPT>
</BODY>
</HTML>
- <HTML>
- <HEAD>
- <TITLE>Fun with Phonics</TITLE>
- <SCRIPT LANGUAGE="JAVASCRIPT">
- <!--Hide from old browsers
- function chngSite() {
- alert("You are about to be transported to the new site location!")
- location = "http://www.scsite.com/"
- }
- //-->
- </SCRIPT>
- </HEAD>
- <BODY>
- <CENTER><IMG SRC="fun.jpg" HSPACE=5 VSPACE=5 HEIGHT=64 WIDTH=129></CENTER>
- <CENTER><HR Width="75%"></CENTER>
- <SCRIPT LANGUAGE="JAVASCRIPT">
- <!--Hide from old browsers
- document.bgColor="red"
- document.bgColor="white"
- document.bgColor="blue"
- document.bgColor="white"
- document.bgColor="green"
- document.bgColor="white"
- document.bgColor="blanchedalmond"
- var tNow = new Date()
- var tlocDate = tNow.toLocaleString()
- var tDate = tlocDate.substring(0,10)
- document.write("<H2><CENTER>Welcome, today is "+tDate+"</CENTER></H2>")
- var intro1 = "Hi, thanks for visiting our Web site, but we have moved. Please make a note "
- var intro2 = "of our new URL (http://www.funphonics.com) and notify the Webmaster about our new "
- var intro3 = "location. Click<A Href='http://www.scsite.com/'> here </A> or wait 15 seconds "
- var intro4 = "to be moved automatically to our new site."
- var introMsg = intro1+intro2+intro3+intro4
- document.write("<H4><FONT Color='firebrick'>"+introMsg+"</H4></FONT>")
- setTimeout("chngSite()",15000)
- document.write("<BR><H4><CENTER>This document was last modified "+document.lastModified+"</CENTER></H4>")
- //-->
- </SCRIPT>
- </BODY>
- </HTML>
The problem I am having is in the document.write statement, it is supposed to display as "Welcome, today is 11/12/2008" instead mine displays as "Welcome, today is Wednesday,". What have I done wrong? Thanks for any help you can provide!!