Web Crossing Server-side JavaScript

Introduction
WCJS and WCTL
Resources
Next Section

Introduction

Web Crossing contains a powerful, major technology in addition to Web Crossing's plethora of features - a complete implementation of server-side JavaScript. Web Crossing JavaScript (WCJS) is thoroughly integrated with Web Crossing's database and conferencing system.

The implications of this new technology cannot be underestimated.

Web page designers who are somewhat familiar with JavaScript often have a preconceived notion about the limits of the language, based on their experience with what can be practically accomplished with JavaScript when embedded inside the HTML of a web page. That kind of JavaScript, called client-side JavaScript (because the JavaScript is executed by the client browser) does have a great many limitations. In addition, experienced web designers are often frustrated by a wide degree of incompatibility in different client-side JavaScript implementations among different browsers. Often even a simple JavaScript program that runs on Netscape Navigator will not run correctly on Microsoft Internet Explorer, or vice-versa.

However, the fact of the matter is JavaScript is an extremely rich, powerful and flexible language in its own right. It has a large, highly developed syntax, a huge library of standard methods (functions) and the built-in capability to create complex, object-oriented data structures and methods.

Web Crossing's version of JavaScript (WCJS) runs on the server-side, executed by Web Crossing itself, and has huge advantages over client-side JavaScript. Among these advantages are:

Web Crossing JavaScript and WCTL

And what of Web Crossing Template Language (WCTL)? How does WCJS fit in with WCTL?

WCTL is a highly optimized proprietary scripting language developed specifically for Web Crossing. The entire user interface is described in templates (special macros) written in WCTL. There are many samples of these templates in the webxStd-local.tpl and webxextn.tpl files (found in your webxTemplates directory) which you can customize. Customizing these templates allow you to change the appearance and operations of your Web Crossing server.

However there are limits to what WCTL is able to do as a programming language. For example, WCTL has no support for arrays, or other complex data types. WCTL does not support user-defined functions with parameter passing. WCTL does not support the creation of complicated new objects (though it does support the creation of new properties for existing objects). WCTL does not have the familiar, strong programming structures such as for loops and switch structures found in other languages. WCTL does not have floating point mathematical functions. WCTL does not allow the creation of object-oriented methods with prototyping. WCTL does not have support for Perl-like regular expressions. All these, and much more, are part of Web Crossing Server-side JavaScript.

In addition, JavaScript is a widely used programming language with many reference materials and libraries of programs already available for you to use as a base for starting your programming.

On the other hand, there are some things that still can be done only in WCTL. For example, non-macro bits and pieces of WCTL (scripts with no names) can be embedded directly inside folder and discussion headers. This can not be done with JavaScript directly at the present time. Also, there are still several WCTL built-in commands and variables for which there are no JavaScript equivalents yet. However, as you will see, you can always call WCTL expressions from inside Web Crossing JavaScript.

The bottom line, with regards to Web Crossing, is this - all future Web Crossing development will concentrate on server-side JavaScript. WCTL will be supported indefinitely for backwards compatibility, but the Web Crossing development language of choice is JavaScript from now on.

If you are not experienced with JavaScript you are strongly encouraged to pick up a book on the subject and try your hand with some programming. If you are already experienced with C, C++ or Java programming, you will find your transition to JavaScript programming very easy, because much of the same syntax is shared by all four languages.

That said, before proceeding with some examples of how to use WCJS, you should first understand JavaScript programming. This documentation assumes you already have some experience programming in JavaScript and will concentrate on how to use JavaScript within the context of Web Crossing, rather than explaining how to program in JavaScript. Enhanced features that are specific to Web Crossing JavaScript are also introduced.

Next Section

The next section will show you how to create and execute a JavaScript function from inside Web Crossing.

Resources

Recommended book:

Developer Center