Link to home
Start Free TrialLog in
Avatar of robinski
robinski

asked on

Beginner with Java

Greetings To All
===========

I have copied a java script to my FP web page. It is supposed to show today's date. It does not increment. I obviously need something else.

Where can I learn "First Steps With Java"?

Thanks,

robinski
ASKER CERTIFIED SOLUTION
Avatar of cbasic100798
cbasic100798

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of cbasic100798
cbasic100798

Sorry I missed the other part of your Q.
This is a good place to start looking for a book on JavaScript.

http://www.wrox.com/Consumer/Store/ListTitles.asp?By=105&Category=Consumer
Clyde
Avatar of robinski

ASKER

cdbasic,

Thanks. I tried and I get the error message:

Line 32
Char 80
Unterminated string comstant.

The page with my attempt is at:

www.vicnet.net.au/~ri9790/clubs/dcreek/

This does not give an erro message but also does not work.

Cheers

robinski
What is the link to the page that has the code I provided?

Clyde
I have only run that on my PWS server
Well now this might be more like the format you are looking for.


<SCRIPT LANGUAGE="Javascript">
<!--
// Array of day names
var dayNames = new Array( "Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
// Array of month Names
var monthNames = new Array( "January","February","March","April","May","June","July","August","September","October","November","December");
var now = new Date();
document.write(dayNames[now.getDay()] + ", " + monthNames[now.getMonth()] + " " + now.getDate() + ", 19" + now.getYear());
// -->
</SCRIPT>

I did a local test OK.
Enjoy
Clyde
Clyde,

Yes that is better. Many thanks.

What was wrong with the original?

robinski.
I don't know it works on my site OK.
Maybe the ghost of christmas past. ;>)

Enjoy the day,
Clyde
Greetings To All
===========

Your code worked until the year end. Now it does not translate the year correctly.

I can edit the script in FP2000 and the preview shows correctly but does not display from the web.

Should I make this another question?

robinski
Howdy robinski,
Send the URL so I can look at the source.

Clyde
Greetings Clyde,

The code is yours from above.

This one has the original:

http://www.vicnet.net.au/~ri9790/clubs/kilmore/

and I have cheated with this one:

http://www.vicnet.net.au/~iwda61/

Thanks for your help and best wishes for the final year of the 20th century

robinski
Howdy,
This is what I see on your page.
"Last Updated      Saturday, January 1, 192000 "

This is your source
document.write(dayNames[now.getDay()] + ", " + monthNames[now.getMonth()] + " " + now.getDate() + ", 19" + now.getYear());

Get rid of the *19* and remove the line break between the *19* and the *+* that should take care of it.

This is how the line should look.
document.write(dayNames[now.getDay()] + ", " + monthNames[now.getMonth()] + " " + now.getDate() + ", " + now.getYear());

Enjoy,
Clyde
Clyde,

I tried this on:

http://www.vicnet.net.au/~ri9790/

Year now shows as 100.

Oh dear! <G>

robinski
Must be the Y2K bug on your end. ;>)
This is what I see.
Last xx Updated      Sunday, January 2, 2000

Go here http://www.cbasic.com/tips/date.htm & let me know what you see.
I copy/pasted your code to this page.

Clyde
BTW,
This script runs on the client side. So it is dependent upon the clients system date. Check your system date. What does it say? Are you Y2K compliant? ;>)

Clyde
Clyde,

Yes I am compliant. My FP editor shows 2000 and your page shows:

Date Test
                                       Monday, January 3, 100


The provider is our State government. We get free space as a community service group.

I also notice that the file date on my FTP client is:

1000103

Is this the culprit?

robinski
Well Robin,
Sure looks like it. Have a friend from another ISP take a look at your page and find out what they see.

Welcome to computing. ;>)
Clyde
Robin,
I just view your page from a different ISP and the date is being displayed correctly.

Enjoy,
Clyde
Clyde,

Did you check the code?

I have added a fixed 2000 over a period of a few hours to most of the site.

I have not yet touched the PRPapers directory so this URL is showing "100" with me.

http://www.vicnet.net.au/~ri9790/district/prpapers/GSEgen.htm

Thanks for taking the interest.

robinski
Did you have a friend from another ISP view the page?
The code is correct, The way it's being displayed at your end is the problem. JavaScripts are client/browser dependent.

Take care and best wishes,
Clyde