Part of the scripting.com web server. San Francisco CA USA. 1/20/97.

Playing with JavaScript

This page was originally written on 12/26/95. It still gets a lot of hits, so I updated the page on 1/20/97. It's part of the scripting.com website, which supports script writers developing websites using Frontier and other tools. Thanks for visiting! DW


Let's figure out what JavaScript is about.

There's a script interpreter built into Netscape. It's not clear when this interpreter appeared. But there are docs on it now at the Netscape website.

I'm running Netscape 2.0b4, which was released on Christmas Eve, but people report that these scripts work with 2.0b3.

Conclusions so far...

You can use JavaScript for data validation. When the user fills in a form, you can check things for consistency, like being sure that a person's age is greater than 0 and less than 130. You can check dates, because JavaScript has lots of date verbs in it.

You can display tables filled with trigonometric values because it has a complete set of trig verbs. You can also access the contents of the Bookmarks menu and a few other internal data structures. You can set various page attributes, which could be nice, you could make it so that all your pages have different display options and buttons at the bottom of each page to change to a different style.

It has a really nice subroutine calling structure, each page can contain (invisible) embedded subroutines, they can even call subroutines on other pages, still haven't gotten this to work, but it's speccd.

Talking with Steve Michel, michel@netcom.com, this morning, and we talked about how nice it would be if there were a hierarchy to a website, where you could define a routine and it would be available to all pages that were subordinate to it in the hierarchy. Yes, websites today usually have a hierarchy, and here's another context where hierarchies make sense.

It'll be interesting. But since we still don't have an idea for a killer script, all this innovation would be for naught because we would have a very elegant scripting environment, but nothing to do with it.

So.... I'm beginning to think that because of the security issues, there really is very little interesting stuff we can do with JavaScript.

Each of following pages contains a little JavaScript demo, illustrating a feature of the language.

Hello World on a Page | Hello World in a Dialog

Multiplication Table | Improved Multiplication Table

Other JavaScript Pages

Dave Winer


This page was last built with Frontier on a Macintosh on Mon, Jan 20, 1997 at 1:37:59 PM. Thanks for checking it out! Dave