It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming JavaScript Forum

Two easy questions

Two easy questions

Postby Nirconus on Thu Mar 29, 2007 1:01 am

Hey there. I'm new to Javascript and I've got two easy questions. First off, why won't these scripts work?

Code: Select all
<script type="text/javascript>
var d = newDate()
theDay=d.GetDay()
switch (theDay)
{
case 0:
  document.write("The day is: <b>Sunday</b>.")
  break
case 1:
  document.write("The day is: <b>Monday</b>.")
  break
case 2:
  document.write("The day is: <b>Tuesday</b>.")
  break
case 3:
  document.write("The day is: <b>Wednesday</b>.")
  break
case 4:
  document.write("The day is: <b>Thursday</b>.")
  break
case 5:
  document.write("The day is: <b>Friday</b>.")
  break
case 6:
  document.write("The day is: <b>Saturday</b>.")
}
</script>


Code: Select all
<script type="text/javascript">
var d = newDate()
theDay=d.GetDay()
switch (theDay)
{
case 1:
  document.write("The day is: <b>Monday</b>.")
  break
case 2:
  document.write("The day is: <b>Tuesday</b>.")
  break
defualt:
  document.write("It is not <b>Monday</b> or <b>Tuesday</b>.")
}
</script>


Secondly, when using an external script command, what should I type in for the actual external script? I know I cannot use the <script> tag in it, so what tags do I need to use? Thanks.
Nirconus
 
Posts: 6
Joined: Thu Mar 29, 2007 12:37 am

Who is online

Users browsing this forum: No registered users and 7 guests

cron