JohnsonBox Posted April 13, 2003 Share Posted April 13, 2003 <HTML> <BODY> <script language="javascript"> <! - - document. write("You are using" + navigator. appName + navigator. appVersion) //- -> </script> <script LANGUAGE="JAVASCRIPT"> <! - - document. write("today" + today.getyear()) // - -> </SCRIPT> </BODY> </HTML> Link to comment Share on other sites More sharing options...
0 Zero_Tolerance Posted April 13, 2003 Share Posted April 13, 2003 well html is wrong .. <html> <head> <title>blank</title> </head> <body bgproperties="fixed" bgcolor="black" text="white"> whatever in here.. that would be more appropriate .. as for the javascript, looks ok .. i tin .. but not sure on the javascript .. Link to comment Share on other sites More sharing options...
0 yashiro Posted April 13, 2003 Share Posted April 13, 2003 <html> <head> <title>blank</title> </head> <body> <p> <script type="text/javascript"> var weekday= new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); var today= new Date(); var myyear=today.getFullYear(); var mymonth=today.getMonth(); var mydate=today.getDate(); var myday=today.getDay(); document.write('You are using : ' + navigator.appName + navigator.appVersion); document.write('<br /><br />'); document. write('today is : ' + weekday[myday]+' '+ mydate +'/'+ mymonth +'/'+ myyear ); document.write('<br /><br />'); document. write('today is : ' + today.toGMTString() +' (GMT)' ); </script> </p> </body> </html> Link to comment Share on other sites More sharing options...
0 BxBoy Posted April 13, 2003 Share Posted April 13, 2003 Nice Coding. Link to comment Share on other sites More sharing options...
0 yashiro Posted April 13, 2003 Share Posted April 13, 2003 I was bored and hadn't messed with js for a loooong time. :D So I thought 'why not'? It can possibly be done better but the original poster should be able to follow it and learn how it's done anyways. Link to comment Share on other sites More sharing options...
0 m0fo Posted April 13, 2003 Share Posted April 13, 2003 ummmm.. try this: <HTML> <BODY> <script language="javascript"> <!-- today = new Date(); document.write("You are using " + navigator.appName + " " + navigator.appVersion + "<br>"); document.write("today " + today.getFullYear()); //--> </SCRIPT> </BODY> </HTML> first: u need to declare today as a new Date in order to use today.get..... 2nd: getYear() is not a valid function but getFullYear() is 3rd: you have extra spaces between navigator and appName or appVersion 4th: put a semicolon ( ; ) after a statement Link to comment Share on other sites More sharing options...
0 JohnsonBox Posted April 13, 2003 Author Share Posted April 13, 2003 Thanks M0fo and Yashiro. Also thank others. Link to comment Share on other sites More sharing options...
Question
JohnsonBox
<HTML>
<BODY>
<script language="javascript">
<! - -
document. write("You are using" + navigator. appName + navigator. appVersion)
//- ->
</script>
<script LANGUAGE="JAVASCRIPT">
<! - -
document. write("today" + today.getyear())
// - ->
</SCRIPT>
</BODY>
</HTML>
Link to comment
Share on other sites
6 answers to this question
Recommended Posts