Re: Javascript beginner

by "Data Driven Design" <jeff(at)datadrivendesign.com>

 Date:  Sat, 9 Jun 2001 16:51:55 -0400
 To:  "InterDesign" <pperry(at)inter-design.net>,
<hwg-languages(at)hwg.org>
 References:  adelphia
  todo: View Thread, Original
There's nothing in that script that requires version 1.2, you could get by
with just javascript

Just a couple of small errors, you need the 'new' key word, and '==' 2= is
the sign for comparison, one = is for assignment, The script as you had it
would set x equal to 10, instead of executing the code when it was 10. Also
getDay() returns the day of the week 0-6 and not the day of the month.

<script language="JavaScript">

.
var v = New Date();
var x = v.getDate();

 if (x == 10)

 {
document.write(v);
 }

</script>


Data Driven Design
P.O. Box 1084
Holly Hill, Florida 32125-1084

http://www.datadrivendesign.com
http://www.rossidesigns.net
----- Original Message -----
From: InterDesign <pperry(at)inter-design.net>
To: <hwg-languages(at)hwg.org>
Sent: Saturday, June 09, 2001 3:10 PM
Subject: Javascript beginner


> Hi,
>
> I can manipulate code already written but now I'm trying to write my own
> code. I thought the script I was doing was going to be simple, but it
> doesn't work....here it is....
>
> <script language="JavaScript1.2">
>
> .
> var v = Date();
> var x = v.getDay();
>
>  if (x= 10)
>
>  {
> document.write(v);
>  }
>
> </script>
>
> Can someone tell me what I did wrong?
>
> Thanks,
>
> Phil
>
>

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.